From 80c806814d9274c6add405b44bb137381a608244 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Mon, 17 Feb 2025 12:58:21 +0100 Subject: [PATCH] Fix: Always prefer ID3 tags --- music_assistant/helpers/tags.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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( -- 2.34.1