Added catch for empty artists and made release type safe
in case deezer adds a new release type
This commit is contained in:
parent
90ff48ab87
commit
49cf460131
|
@ -1,3 +1,3 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
__version__ = "1.5.10"
|
__version__ = "1.5.11"
|
||||||
|
|
|
@ -391,7 +391,7 @@ class Deezer:
|
||||||
def get_artist_discography_gw(self, art_id, nb=100):
|
def get_artist_discography_gw(self, art_id, nb=100):
|
||||||
start = 0
|
start = 0
|
||||||
releases = []
|
releases = []
|
||||||
RELEASE_TYPE = ["single", "album", "compile", "ep", "bundle"]
|
RELEASE_TYPE = {0:"single", 1:"album", 2:"compile", 3:"ep", 4:"bundle"}
|
||||||
result = {'all': []}
|
result = {'all': []}
|
||||||
IDs = []
|
IDs = []
|
||||||
while True:
|
while True:
|
||||||
|
@ -415,7 +415,7 @@ class Deezer:
|
||||||
'genre_id': release['GENRE_ID'],
|
'genre_id': release['GENRE_ID'],
|
||||||
'fans': release['RANK'],
|
'fans': release['RANK'],
|
||||||
'release_date': release['PHYSICAL_RELEASE_DATE'],
|
'release_date': release['PHYSICAL_RELEASE_DATE'],
|
||||||
'record_type': RELEASE_TYPE[int(release['TYPE'])],
|
'record_type': RELEASE_TYPE.get(int(release['TYPE']), "unknown"),
|
||||||
'tracklist': f"https://api.deezer.com/album/{release['ALB_ID']}/tracks",
|
'tracklist': f"https://api.deezer.com/album/{release['ALB_ID']}/tracks",
|
||||||
'explicit_lyrics': int(release['EXPLICIT_LYRICS']) > 0,
|
'explicit_lyrics': int(release['EXPLICIT_LYRICS']) > 0,
|
||||||
'type': release['__TYPE__'],
|
'type': release['__TYPE__'],
|
||||||
|
|
|
@ -185,7 +185,7 @@ class QueueManager:
|
||||||
if interface: interface.send("startAddingArtist", {'name': artistAPI['name'], 'id': artistAPI['id']})
|
if interface: interface.send("startAddingArtist", {'name': artistAPI['name'], 'id': artistAPI['id']})
|
||||||
|
|
||||||
artistDiscographyAPI = dz.get_artist_discography_gw(id, 100)
|
artistDiscographyAPI = dz.get_artist_discography_gw(id, 100)
|
||||||
allReleases = artistDiscographyAPI.pop('all', None)
|
allReleases = artistDiscographyAPI.pop('all', [])
|
||||||
albumList = []
|
albumList = []
|
||||||
for album in allReleases:
|
for album in allReleases:
|
||||||
albumList.append(self.generateAlbumQueueItem(dz, album['id'], settings, bitrate))
|
albumList.append(self.generateAlbumQueueItem(dz, album['id'], settings, bitrate))
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="deemix",
|
name="deemix",
|
||||||
version="1.5.10",
|
version="1.5.11",
|
||||||
description="A barebone deezer downloader library",
|
description="A barebone deezer downloader library",
|
||||||
long_description=README,
|
long_description=README,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|
Loading…
Reference in New Issue