From 368e05933ede79f4662bdea47d87a24267463153 Mon Sep 17 00:00:00 2001 From: billy <=> Date: Fri, 24 Jul 2026 08:21:26 -0400 Subject: [PATCH] implement wave flac m4a aiff --- components/HeaderTags.py | 2 +- utils/get_tags.py | 6 +++--- utils/set_tag.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/HeaderTags.py b/components/HeaderTags.py index e5d3fd2..bde5926 100644 --- a/components/HeaderTags.py +++ b/components/HeaderTags.py @@ -86,7 +86,7 @@ class ID3Field: editable: bool = True -class HeaderTags2: +class MP3HeaderTags: def __init__(self): self.headers = [ ID3Field(frame_class=TIT2, frame_id="TIT2", db="title", gui="Title"), diff --git a/utils/get_tags.py b/utils/get_tags.py index 8197d79..4d0eae8 100644 --- a/utils/get_tags.py +++ b/utils/get_tags.py @@ -188,7 +188,6 @@ def id3_remap(audio: MP3 | ID3 | FLAC | WAVE | AIFF | MP4) -> dict[str, str | in remap[k] = v.text[0] if hasattr(v, "text") else str(v) if isinstance(audio, MP4): - tags = audio.tags or {} remap = { "title": audio.get("©nam"), @@ -209,10 +208,11 @@ def id3_remap(audio: MP3 | ID3 | FLAC | WAVE | AIFF | MP4) -> dict[str, str | in remap[k] = str(v) if isinstance(audio, FLAC): - tags = audio.tags or {} + print(f'flac instance: {audio}') + print(f'flac instance title: {audio.get("title")}') remap = { - "title": audio.get("title"), + "title": audio.get("title")[0], "artist": audio.get("artist"), "album": audio.get("album"), "track_number": audio.get("tracknumber"), diff --git a/utils/set_tag.py b/utils/set_tag.py index d8d5b1a..9bc4ef6 100644 --- a/utils/set_tag.py +++ b/utils/set_tag.py @@ -1,6 +1,6 @@ from logging import debug, error, warning from components import ErrorDialog -from components.HeaderTags import HeaderTags2 +from components.HeaderTags import MP3HeaderTags from mutagen.id3 import ID3 from mutagen.id3._util import ID3NoHeaderError from mutagen.id3._frames import USLT, Frame @@ -18,7 +18,7 @@ def set_tag(filepath: str, db_column: str, value: str): Returns: True / False """ - headers = HeaderTags2() + headers = MP3HeaderTags() # debug(f"filepath: {filepath} | db_column: {db_column} | value: {value}") try: