From 77e23ba52c97954225022a4a52ae8680b6c5a96e Mon Sep 17 00:00:00 2001 From: "Troll (Hermes Agent)" Date: Sat, 1 Aug 2026 22:35:51 +0000 Subject: [PATCH] Fix MP3 comment tagging and remove Genre from settings metadata --- app.py | 6 ++++-- booth_settings.json | 7 +++++++ templates/admin/settings.html | 4 ---- 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 booth_settings.json diff --git a/app.py b/app.py index 2168a62..05a6be4 100644 --- a/app.py +++ b/app.py @@ -159,13 +159,15 @@ def apply_mp3_tags(path, title=None): audio.save() - # Comment requires a real ID3 frame, not EasyID3. + # Comment requires a real ID3 frame, not EasyID3. Write both COMM and a TXXX + # "Comment" frame for broad compatibility across players and readers. if cfg.get('comment'): - from mutagen.id3 import ID3, COMM + from mutagen.id3 import COMM, TXXX audio2 = MP3(path) if audio2.tags is None: audio2.add_tags() audio2.tags["COMM"] = COMM(encoding=3, lang='eng', desc='Comment', text=cfg['comment']) + audio2.tags["TXXX:Comment"] = TXXX(encoding=3, desc='Comment', text=cfg['comment']) audio2.save() except Exception as e: # Don't fail the upload just because tagging failed; log/flash only if inside request context. diff --git a/booth_settings.json b/booth_settings.json new file mode 100644 index 0000000..4e05dd3 --- /dev/null +++ b/booth_settings.json @@ -0,0 +1,7 @@ +{ + "artist": "Trollgorithm", + "album": "Theme Booth 2026", + "year": "2026", + "genre": null, + "comment": "Custom booth song comment" +} \ No newline at end of file diff --git a/templates/admin/settings.html b/templates/admin/settings.html index ddc68cd..78dc7de 100644 --- a/templates/admin/settings.html +++ b/templates/admin/settings.html @@ -237,10 +237,6 @@ Year - - Genre - - Comment