From c695e7822440d02fff4d117416d2c7379d7102d7 Mon Sep 17 00:00:00 2001 From: Melvyn Harbour Date: Tue, 23 Jul 2024 11:00:42 +0100 Subject: [PATCH] Guard against eyed3 misread (#1511) --- music_assistant/server/helpers/tags.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/music_assistant/server/helpers/tags.py b/music_assistant/server/helpers/tags.py index a0121b45..d17b55f6 100644 --- a/music_assistant/server/helpers/tags.py +++ b/music_assistant/server/helpers/tags.py @@ -447,10 +447,11 @@ 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) - 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() - break + if 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() + break return tags except (KeyError, ValueError, JSONDecodeError, InvalidDataError) as err: -- 2.34.1