Handle ID3NoHeaderError for qobuz mp3

This commit is contained in:
Nathan Thomas 2023-12-24 11:26:02 -08:00
parent 86595984a0
commit df44ae75a5

View file

@ -8,6 +8,7 @@ from mutagen.flac import FLAC, Picture
from mutagen.id3 import (
APIC, # type: ignore
ID3,
ID3NoHeaderError,
)
from mutagen.mp4 import MP4, MP4Cover
@ -106,7 +107,10 @@ class Container(Enum):
elif self == Container.AAC:
return MP4(path)
elif self == Container.MP3:
try:
return ID3(path)
except ID3NoHeaderError:
return ID3()
# unreachable
return {}