Fixed download of tracks with no explicit data
This commit is contained in:
parent
7a932c376b
commit
a6f5b75577
|
@ -107,7 +107,7 @@ class QueueManager:
|
||||||
trackAPI['FILENAME_TEMPLATE'] = settings['albumTracknameTemplate']
|
trackAPI['FILENAME_TEMPLATE'] = settings['albumTracknameTemplate']
|
||||||
collection.append(trackAPI)
|
collection.append(trackAPI)
|
||||||
|
|
||||||
explicit = albumAPI_gw['EXPLICIT_ALBUM_CONTENT']['EXPLICIT_LYRICS_STATUS'] in [LyricsStatus.EXPLICIT, LyricsStatus.PARTIALLY_EXPLICIT]
|
explicit = albumAPI_gw.get('EXPLICIT_ALBUM_CONTENT', {}).get('EXPLICIT_LYRICS_STATUS', LyricsStatus.UNKNOWN) in [LyricsStatus.EXPLICIT, LyricsStatus.PARTIALLY_EXPLICIT]
|
||||||
|
|
||||||
return QICollection(
|
return QICollection(
|
||||||
id=id,
|
id=id,
|
||||||
|
@ -151,7 +151,7 @@ class QueueManager:
|
||||||
playlistAPI['nb_tracks'] = totalSize
|
playlistAPI['nb_tracks'] = totalSize
|
||||||
collection = []
|
collection = []
|
||||||
for pos, trackAPI in enumerate(playlistTracksAPI, start=1):
|
for pos, trackAPI in enumerate(playlistTracksAPI, start=1):
|
||||||
if trackAPI['EXPLICIT_TRACK_CONTENT'].get('EXPLICIT_LYRICS_STATUS', LyricsStatus.UNKNOWN) in [LyricsStatus.EXPLICIT, LyricsStatus.PARTIALLY_EXPLICIT]:
|
if trackAPI.get('EXPLICIT_TRACK_CONTENT', {}).get('EXPLICIT_LYRICS_STATUS', LyricsStatus.UNKNOWN) in [LyricsStatus.EXPLICIT, LyricsStatus.PARTIALLY_EXPLICIT]:
|
||||||
playlistAPI['explicit'] = True
|
playlistAPI['explicit'] = True
|
||||||
trackAPI['_EXTRA_PLAYLIST'] = playlistAPI
|
trackAPI['_EXTRA_PLAYLIST'] = playlistAPI
|
||||||
trackAPI['POSITION'] = pos
|
trackAPI['POSITION'] = pos
|
||||||
|
@ -258,7 +258,7 @@ class QueueManager:
|
||||||
playlistAPI['nb_tracks'] = totalSize
|
playlistAPI['nb_tracks'] = totalSize
|
||||||
collection = []
|
collection = []
|
||||||
for pos, trackAPI in enumerate(artistTopTracksAPI_gw, start=1):
|
for pos, trackAPI in enumerate(artistTopTracksAPI_gw, start=1):
|
||||||
if trackAPI['EXPLICIT_TRACK_CONTENT'].get('EXPLICIT_LYRICS_STATUS', LyricsStatus.UNKNOWN) in [LyricsStatus.EXPLICIT, LyricsStatus.PARTIALLY_EXPLICIT]:
|
if trackAPI.get('EXPLICIT_TRACK_CONTENT', {}).get('EXPLICIT_LYRICS_STATUS', LyricsStatus.UNKNOWN) in [LyricsStatus.EXPLICIT, LyricsStatus.PARTIALLY_EXPLICIT]:
|
||||||
playlistAPI['explicit'] = True
|
playlistAPI['explicit'] = True
|
||||||
trackAPI['_EXTRA_PLAYLIST'] = playlistAPI
|
trackAPI['_EXTRA_PLAYLIST'] = playlistAPI
|
||||||
trackAPI['POSITION'] = pos
|
trackAPI['POSITION'] = pos
|
||||||
|
|
|
@ -273,9 +273,8 @@ class Track:
|
||||||
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 albumAPI_gw.get('EXPLICIT_ALBUM_CONTENT') and albumAPI_gw['EXPLICIT_ALBUM_CONTENT'].get('EXPLICIT_LYRICS_STATUS'):
|
explicitLyricsStatus = albumAPI_gw.get('EXPLICIT_ALBUM_CONTENT', {}).get('EXPLICIT_LYRICS_STATUS', LyricsStatus.UNKNOWN)
|
||||||
explicitLyricsStatus = albumAPI_gw['EXPLICIT_ALBUM_CONTENT']['EXPLICIT_LYRICS_STATUS']
|
self.album['explicit'] = explicitLyricsStatus in [LyricsStatus.EXPLICIT, LyricsStatus.PARTIALLY_EXPLICIT]
|
||||||
self.album['explicit'] = explicitLyricsStatus in [LyricsStatus.EXPLICIT, LyricsStatus.PARTIALLY_EXPLICIT]
|
|
||||||
|
|
||||||
if not self.album['pic']:
|
if not self.album['pic']:
|
||||||
self.album['pic'] = albumAPI_gw['ALB_PICTURE']
|
self.album['pic'] = albumAPI_gw['ALB_PICTURE']
|
||||||
|
|
Loading…
Reference in New Issue