From 00125b1f3f99c6a4bce638ae6ad578c21344bd12 Mon Sep 17 00:00:00 2001 From: SemvdHoeven Date: Wed, 11 Feb 2026 11:27:52 +0100 Subject: [PATCH] fix setting tag --- make_folders.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/make_folders.py b/make_folders.py index 191b0fc..202183d 100755 --- a/make_folders.py +++ b/make_folders.py @@ -236,10 +236,13 @@ def check_title_songname(x: str, audio): # Set both TPE1 (song artist) and TPE2 (album artist) audio["TPE1"] = TPE1(encoding=3, text=artist) audio["TPE2"] = TPE2(encoding=3, text=artist) - audio["artist"] = artist + # Only set 'artist' as a string for FLAC, not for MP3 + if hasattr(audio, 'mime') and audio.mime and 'flac' in audio.mime[0].lower(): + audio["artist"] = artist # Set title tags audio["TIT2"] = TIT2(encoding=3, text=title) - audio["title"] = title + if hasattr(audio, 'mime') and audio.mime and 'flac' in audio.mime[0].lower(): + audio["title"] = title logging.info(f"Set artist: {artist}, title: {title}") else: logging.info("no - found in title, setting full name as title: " + x)