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)