From 4e7b170720a3240318cf10483732eb8ac715ec12 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sun, 20 Sep 2020 10:50:09 +0200 Subject: [PATCH] Added compilation tag to deezer's compilations --- deemix/app/track.py | 6 +++--- deemix/utils/taggers.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deemix/app/track.py b/deemix/app/track.py index 42d8c93..d85a423 100644 --- a/deemix/app/track.py +++ b/deemix/app/track.py @@ -63,7 +63,7 @@ class Track: self.playlist['artist'] = {"Main": []} self.playlist['artists'] = [] self.playlist['trackTotal'] = trackAPI_gw["_EXTRA_PLAYLIST"]['nb_tracks'] - self.playlist['recordType'] = "Compilation" + self.playlist['recordType'] = "compile" self.playlist['barcode'] = "" self.playlist['label'] = "" self.playlist['explicit'] = trackAPI_gw['_EXTRA_PLAYLIST']['explicit'] @@ -128,7 +128,7 @@ class Track: self.album['genre'] = [] self.album['label'] = "Unknown" self.album['mainArtist'] = self.mainArtist - self.album['recordType'] = "Album" + self.album['recordType'] = "album" self.album['trackTotal'] = "0" self.bpm = 0 self.contributors = {} @@ -265,7 +265,7 @@ class Track: self.album['mainArtist']['pic'] = artistAPI['picture_small'][artistAPI['picture_small'].find('artist/') + 7:-24] self.album['trackTotal'] = albumAPI_gw['NUMBER_TRACK'] 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']) 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] diff --git a/deemix/utils/taggers.py b/deemix/utils/taggers.py index 52cda8c..1ef5754 100644 --- a/deemix/utils/taggers.py +++ b/deemix/utils/taggers.py @@ -76,7 +76,7 @@ def tagID3(stream, track, save): if save['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")) if save['cover'] and track.album['picPath']: @@ -156,7 +156,7 @@ def tagFLAC(stream, track, save): if save['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" if save['cover'] and track.album['picPath']: