implement wave flac m4a aiff

This commit is contained in:
billy 2026-07-24 08:21:26 -04:00
parent 890a6171c9
commit 368e05933e
3 changed files with 6 additions and 6 deletions

View File

@ -86,7 +86,7 @@ class ID3Field:
editable: bool = True editable: bool = True
class HeaderTags2: class MP3HeaderTags:
def __init__(self): def __init__(self):
self.headers = [ self.headers = [
ID3Field(frame_class=TIT2, frame_id="TIT2", db="title", gui="Title"), ID3Field(frame_class=TIT2, frame_id="TIT2", db="title", gui="Title"),

View File

@ -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) remap[k] = v.text[0] if hasattr(v, "text") else str(v)
if isinstance(audio, MP4): if isinstance(audio, MP4):
tags = audio.tags or {}
remap = { remap = {
"title": audio.get("©nam"), "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) remap[k] = str(v)
if isinstance(audio, FLAC): if isinstance(audio, FLAC):
tags = audio.tags or {} print(f'flac instance: {audio}')
print(f'flac instance title: {audio.get("title")}')
remap = { remap = {
"title": audio.get("title"), "title": audio.get("title")[0],
"artist": audio.get("artist"), "artist": audio.get("artist"),
"album": audio.get("album"), "album": audio.get("album"),
"track_number": audio.get("tracknumber"), "track_number": audio.get("tracknumber"),

View File

@ -1,6 +1,6 @@
from logging import debug, error, warning from logging import debug, error, warning
from components import ErrorDialog from components import ErrorDialog
from components.HeaderTags import HeaderTags2 from components.HeaderTags import MP3HeaderTags
from mutagen.id3 import ID3 from mutagen.id3 import ID3
from mutagen.id3._util import ID3NoHeaderError from mutagen.id3._util import ID3NoHeaderError
from mutagen.id3._frames import USLT, Frame from mutagen.id3._frames import USLT, Frame
@ -18,7 +18,7 @@ def set_tag(filepath: str, db_column: str, value: str):
Returns: Returns:
True / False True / False
""" """
headers = HeaderTags2() headers = MP3HeaderTags()
# debug(f"filepath: {filepath} | db_column: {db_column} | value: {value}") # debug(f"filepath: {filepath} | db_column: {db_column} | value: {value}")
try: try: