Added compilation tag to deezer's compilations

This commit is contained in:
RemixDev 2020-09-20 10:50:09 +02:00
parent 6f1e7ccbb1
commit 4e7b170720
2 changed files with 5 additions and 5 deletions

View File

@ -63,7 +63,7 @@ class Track:
self.playlist['artist'] = {"Main": []} self.playlist['artist'] = {"Main": []}
self.playlist['artists'] = [] self.playlist['artists'] = []
self.playlist['trackTotal'] = trackAPI_gw["_EXTRA_PLAYLIST"]['nb_tracks'] self.playlist['trackTotal'] = trackAPI_gw["_EXTRA_PLAYLIST"]['nb_tracks']
self.playlist['recordType'] = "Compilation" self.playlist['recordType'] = "compile"
self.playlist['barcode'] = "" self.playlist['barcode'] = ""
self.playlist['label'] = "" self.playlist['label'] = ""
self.playlist['explicit'] = trackAPI_gw['_EXTRA_PLAYLIST']['explicit'] self.playlist['explicit'] = trackAPI_gw['_EXTRA_PLAYLIST']['explicit']
@ -128,7 +128,7 @@ class Track:
self.album['genre'] = [] self.album['genre'] = []
self.album['label'] = "Unknown" self.album['label'] = "Unknown"
self.album['mainArtist'] = self.mainArtist self.album['mainArtist'] = self.mainArtist
self.album['recordType'] = "Album" self.album['recordType'] = "album"
self.album['trackTotal'] = "0" self.album['trackTotal'] = "0"
self.bpm = 0 self.bpm = 0
self.contributors = {} self.contributors = {}
@ -265,7 +265,7 @@ class Track:
self.album['mainArtist']['pic'] = artistAPI['picture_small'][artistAPI['picture_small'].find('artist/') + 7:-24] self.album['mainArtist']['pic'] = artistAPI['picture_small'][artistAPI['picture_small'].find('artist/') + 7:-24]
self.album['trackTotal'] = albumAPI_gw['NUMBER_TRACK'] self.album['trackTotal'] = albumAPI_gw['NUMBER_TRACK']
self.album['discTotal'] = albumAPI_gw['NUMBER_DISK'] self.album['discTotal'] = albumAPI_gw['NUMBER_DISK']
self.album['recordType'] = "Album" self.album['recordType'] = "album"
self.album['label'] = albumAPI_gw.get('LABEL_NAME', self.album['label']) self.album['label'] = albumAPI_gw.get('LABEL_NAME', self.album['label'])
if 'EXPLICIT_ALBUM_CONTENT' in albumAPI_gw and 'EXPLICIT_LYRICS_STATUS' in albumAPI_gw['EXPLICIT_ALBUM_CONTENT']: if 'EXPLICIT_ALBUM_CONTENT' in albumAPI_gw and 'EXPLICIT_LYRICS_STATUS' in albumAPI_gw['EXPLICIT_ALBUM_CONTENT']:
self.album['explicit'] = albumAPI_gw['EXPLICIT_ALBUM_CONTENT']['EXPLICIT_LYRICS_STATUS'] in [1,4] self.album['explicit'] = albumAPI_gw['EXPLICIT_ALBUM_CONTENT']['EXPLICIT_LYRICS_STATUS'] in [1,4]

View File

@ -76,7 +76,7 @@ def tagID3(stream, track, save):
if save['copyright']: if save['copyright']:
tag.add(TCOP(text=track.copyright)) tag.add(TCOP(text=track.copyright))
if save['savePlaylistAsCompilation'] and track.playlist: if save['savePlaylistAsCompilation'] and track.playlist or track.album['recordType'] == "compile":
tag.add(TCMP(text="1")) tag.add(TCMP(text="1"))
if save['cover'] and track.album['picPath']: if save['cover'] and track.album['picPath']:
@ -156,7 +156,7 @@ def tagFLAC(stream, track, save):
if save['copyright']: if save['copyright']:
tag["COPYRIGHT"] = track.copyright tag["COPYRIGHT"] = track.copyright
if save['savePlaylistAsCompilation'] and track.playlist: if save['savePlaylistAsCompilation'] and track.playlist or track.album['recordType'] == "compile":
tag["COMPILATION"] = "1" tag["COMPILATION"] = "1"
if save['cover'] and track.album['picPath']: if save['cover'] and track.album['picPath']: