fix setting tag

This commit is contained in:
SemvdHoeven
2026-02-11 11:27:52 +01:00
parent e3c8be9eb8
commit 00125b1f3f

View File

@@ -236,10 +236,13 @@ def check_title_songname(x: str, audio):
# Set both TPE1 (song artist) and TPE2 (album artist) # Set both TPE1 (song artist) and TPE2 (album artist)
audio["TPE1"] = TPE1(encoding=3, text=artist) audio["TPE1"] = TPE1(encoding=3, text=artist)
audio["TPE2"] = TPE2(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 # Set title tags
audio["TIT2"] = TIT2(encoding=3, text=title) 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}") logging.info(f"Set artist: {artist}, title: {title}")
else: else:
logging.info("no - found in title, setting full name as title: " + x) logging.info("no - found in title, setting full name as title: " + x)