sane-tag-music: auto-create id3 tags for MP3 files

This commit is contained in:
Colin 2023-12-07 17:39:28 +00:00
parent 0db1e3728a
commit 4ae01aa353

View File

@ -11,6 +11,7 @@ import logging
import os.path
import mutagen.easyid3
import mutagen.flac
import mutagen.mp3
import mutagen.oggopus
import mutagen.oggvorbis
@ -245,9 +246,11 @@ class AudioFile:
# - .wma
if ext == '.flac':
self.muta = mutagen.flac.Open(path_)
elif ext in ['.aac', '.mp3']:
elif ext == '.aac':
# TODO: this seems to only read tags, and not create them?
self.muta = mutagen.easyid3.EasyID3(path_)
elif ext == '.mp3':
self.muta = mutagen.mp3.EasyMP3(path_)
elif ext == '.ogg':
self.muta = mutagen.oggvorbis.OggVorbis(path_)
elif ext == '.opus':