Guard against eyed3 returning None (#1599)
authorDavid McClosky <notsoweird+github@gmail.com>
Fri, 23 Aug 2024 07:05:12 +0000 (03:05 -0400)
committerGitHub <noreply@github.com>
Fri, 23 Aug 2024 07:05:12 +0000 (09:05 +0200)
music_assistant/server/helpers/tags.py

index d17b55f686ef9bb1bf10932aae63ef14e0f258cb..627546d5b94684035305ec7da2c67500c29b75a8 100644 (file)
@@ -447,7 +447,7 @@ async def parse_tags(
             # this is actually a bug in ffmpeg/ffprobe which does not expose this tag
             # so we use this as alternative approach for mp3 files
             audiofile = await asyncio.to_thread(eyed3.load, file_path)
-            if audiofile.tag is not None:
+            if audiofile is not None and audiofile.tag is not None:
                 for uf_id in audiofile.tag.unique_file_ids:
                     if uf_id.owner_id == b"http://musicbrainz.org" and uf_id.uniq_id:
                         tags.tags["musicbrainzrecordingid"] = uf_id.uniq_id.decode()