Remove duplicate releases when getting artist discography

This commit is contained in:
RemixDev 2020-08-11 22:30:07 +02:00
parent d22f55c279
commit 42842b07b8
3 changed files with 38 additions and 35 deletions

View File

@ -1,3 +1,3 @@
#!/usr/bin/env python3
__version__ = "1.1.30"
__version__ = "1.1.31"

View File

@ -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'],

View File

@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text()
setup(
name="deemix",
version="1.1.30",
version="1.1.31",
description="A barebone deezer downloader library",
long_description=README,
long_description_content_type="text/markdown",