Remove duplicate releases when getting artist discography
This commit is contained in:
parent
d22f55c279
commit
42842b07b8
|
@ -1,3 +1,3 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
__version__ = "1.1.30"
|
||||
__version__ = "1.1.31"
|
||||
|
|
|
@ -280,6 +280,7 @@ class Deezer:
|
|||
releases = []
|
||||
RELEASE_TYPE = ["single", "album", "compile", "ep"]
|
||||
result = {'all': []}
|
||||
IDs = []
|
||||
while True:
|
||||
response = self.gw_api_call('album.getDiscography', {'art_id': art_id, "discography_mode":"all", 'nb': nb, 'nb_songs': 0, 'start': start})
|
||||
releases += response['results']['data']
|
||||
|
@ -287,6 +288,8 @@ class Deezer:
|
|||
if start > response['results']['total']:
|
||||
break
|
||||
for release in releases:
|
||||
if release['ALB_ID'] not in IDs:
|
||||
IDs.append(release['ALB_ID'])
|
||||
obj = {
|
||||
'id': release['ALB_ID'],
|
||||
'title': release['ALB_TITLE'],
|
||||
|
|
Loading…
Reference in New Issue