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