mirror of
https://gitlab.com/RemixDev/deemix-py.git
synced 2024-12-29 11:06:14 +00:00
Added option for saving cover description as UTF8
This commit is contained in:
parent
b0014f5219
commit
5fa251ae3a
|
@ -1,3 +1,3 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
__version__ = "1.3.12"
|
||||
__version__ = "1.3.13"
|
||||
|
|
|
@ -92,7 +92,8 @@ class Settings:
|
|||
"useNullSeparator": False,
|
||||
"saveID3v1": True,
|
||||
"multiArtistSeparator": "default",
|
||||
"singleAlbumArtist": False
|
||||
"singleAlbumArtist": False,
|
||||
"coverDescriptionUTF8": False
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
from mutagen.flac import FLAC, Picture
|
||||
from mutagen.id3 import ID3, ID3NoHeaderError, TXXX, TIT2, TPE1, TALB, TPE2, TRCK, TPOS, TCON, TYER, TDAT, TLEN, TBPM, \
|
||||
TPUB, TSRC, USLT, SYLT, APIC, IPLS, TCOM, TCOP, TCMP
|
||||
TPUB, TSRC, USLT, SYLT, APIC, IPLS, TCOM, TCOP, TCMP, Encoding
|
||||
|
||||
# Adds tags to a MP3 file
|
||||
def tagID3(stream, track, save):
|
||||
|
@ -63,7 +63,7 @@ def tagID3(stream, track, save):
|
|||
if track.lyrics['unsync'] and save['lyrics']:
|
||||
tag.add(USLT(text=track.lyrics['unsync']))
|
||||
if track.lyrics['syncID3'] and save['syncedLyrics']:
|
||||
tag.add(SYLT(3, format=2, type=1, text=track.lyrics['syncID3']))
|
||||
tag.add(SYLT(Encoding.UTF8, format=2, type=1, text=track.lyrics['syncID3']))
|
||||
|
||||
involved_people = []
|
||||
for role in track.contributors:
|
||||
|
@ -83,7 +83,7 @@ def tagID3(stream, track, save):
|
|||
if save['cover'] and track.album['picPath']:
|
||||
with open(track.album['picPath'], 'rb') as f:
|
||||
tag.add(
|
||||
APIC(0, 'image/jpeg' if track.album['picPath'].endswith('jpg') else 'image/png', 3, desc='cover', data=f.read()))
|
||||
APIC(Encoding.UTF8 if save['coverDescriptionUTF8'] else Encoding.LATIN1, 'image/jpeg' if track.album['picPath'].endswith('jpg') else 'image/png', 3, desc='cover', data=f.read()))
|
||||
|
||||
tag.save(stream, v1=2 if save['saveID3v1'] else 0, v2_version=3,
|
||||
v23_sep=None if save['useNullSeparator'] else '/')
|
||||
|
|
Loading…
Reference in a new issue