From: Marcel van der Veldt Date: Mon, 17 Feb 2025 11:58:21 +0000 (+0100) Subject: Fix: Always prefer ID3 tags X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=80c806814d9274c6add405b44bb137381a608244;p=music-assistant-server.git Fix: Always prefer ID3 tags --- diff --git a/music_assistant/helpers/tags.py b/music_assistant/helpers/tags.py index 6ff8ece5..987cdf11 100644 --- a/music_assistant/helpers/tags.py +++ b/music_assistant/helpers/tags.py @@ -392,10 +392,14 @@ class AudioTags: x for x in raw["streams"] if x.get("codec_name", "") in ("mjpeg", "png") ) # convert all tag-keys (gathered from all streams) to lowercase without spaces + # prefer format as that contains the actual ID3 tags + # append any tags found in streams (but don't overwrite format tags) tags = {} - for stream in raw["streams"] + [raw["format"]]: + for stream in [raw["format"]] + raw["streams"]: for key, value in stream.get("tags", {}).items(): alt_key = key.lower().replace(" ", "").replace("_", "").replace("-", "") + if alt_key in tags: + continue tags[alt_key] = value return AudioTags(