diff --git a/rose/audiotags.py b/rose/audiotags.py index 70b1969..81e2002 100644 --- a/rose/audiotags.py +++ b/rose/audiotags.py @@ -142,11 +142,11 @@ def _get_paired_frame(x: str) -> str | None: return None return AudioTags( - id=_get_tag(m.tags, ["TXXX:ROSEID"]), - release_id=_get_tag(m.tags, ["TXXX:ROSERELEASEID"]), + id=_get_tag(m.tags, ["TXXX:ROSEID"], first=True), + release_id=_get_tag(m.tags, ["TXXX:ROSERELEASEID"], first=True), title=_get_tag(m.tags, ["TIT2"]), releaseyear=_parse_year(_get_tag(m.tags, ["TDRC", "TYER"])), - compositionyear=_parse_year(_get_tag(m.tags, ["TXXX:COMPOSITIONDATE"])), + compositionyear=_parse_year(_get_tag(m.tags, ["TXXX:COMPOSITIONDATE"], first=True)), tracknumber=tracknumber, tracktotal=tracktotal, discnumber=discnumber, @@ -154,7 +154,7 @@ def _get_paired_frame(x: str) -> str | None: release=_get_tag(m.tags, ["TALB"]), genre=_split_tag(_get_tag(m.tags, ["TCON"], split=True)), label=_split_tag(_get_tag(m.tags, ["TPUB"], split=True)), - catalognumber=_get_tag(m.tags, ["TXXX:CATALOGNUMBER"]), + catalognumber=_get_tag(m.tags, ["TXXX:CATALOGNUMBER"], first=True), releasetype=_normalize_rtype(_get_tag(m.tags, ["TXXX:RELEASETYPE"], first=True)), releaseartists=parse_artist_string(main=_get_tag(m.tags, ["TPE2"], split=True)), trackartists=parse_artist_string( @@ -273,7 +273,7 @@ def _write_tag_with_description(name: str, value: str | None) -> None: keep_fields = [f for f in m.tags.getall(key) if getattr(f, "desc", None) != desc] m.tags.delall(key) if value: - frame = getattr(mutagen.id3, key)(desc=desc, text=value) + frame = getattr(mutagen.id3, key)(desc=desc, text=[value]) m.tags.add(frame) for f in keep_fields: m.tags.add(f) diff --git a/testdata/Tagger/track1.flac b/testdata/Tagger/track1.flac index 7597873..0054e72 100644 Binary files a/testdata/Tagger/track1.flac and b/testdata/Tagger/track1.flac differ diff --git a/testdata/Tagger/track2.m4a b/testdata/Tagger/track2.m4a index a845d68..7e675ef 100644 Binary files a/testdata/Tagger/track2.m4a and b/testdata/Tagger/track2.m4a differ diff --git a/testdata/Tagger/track3.mp3 b/testdata/Tagger/track3.mp3 index 4a884bb..ae9cac0 100644 Binary files a/testdata/Tagger/track3.mp3 and b/testdata/Tagger/track3.mp3 differ diff --git a/testdata/Tagger/track4.vorbis.ogg b/testdata/Tagger/track4.vorbis.ogg index 10060cf..83bea21 100644 Binary files a/testdata/Tagger/track4.vorbis.ogg and b/testdata/Tagger/track4.vorbis.ogg differ diff --git a/testdata/Tagger/track5.opus.ogg b/testdata/Tagger/track5.opus.ogg index 55cc8f0..d390bde 100644 Binary files a/testdata/Tagger/track5.opus.ogg and b/testdata/Tagger/track5.opus.ogg differ diff --git a/testdata/Tagger/update.py b/testdata/Tagger/update.py index a3d2a66..5cc916f 100755 --- a/testdata/Tagger/update.py +++ b/testdata/Tagger/update.py @@ -12,7 +12,7 @@ def write_tag_with_description(f: Any, name: str, value: str | None) -> None: keep_fields = [f for f in f.tags.getall(key) if getattr(f, "desc", None) != desc] f.tags.delall(key) if value: - frame = getattr(mutagen.id3, key)(desc=desc, text=value) + frame = getattr(mutagen.id3, key)(desc=desc, text=[value]) f.tags.add(frame) for x in keep_fields: f.tags.add(x)