fix setting tag
This commit is contained in:
@@ -236,9 +236,12 @@ 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)
|
||||
# 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)
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user