Added better workaround for #2

This commit is contained in:
RemixDev 2020-07-24 11:28:42 +02:00
parent f3b36b3ea3
commit ec38923701
3 changed files with 10 additions and 8 deletions

View File

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

View File

@ -288,10 +288,11 @@ def getTrackData(dz, trackAPI_gw, settings, trackAPI=None, albumAPI_gw=None, alb
track['album']['artists'] = [] track['album']['artists'] = []
for artist in albumAPI['contributors']: for artist in albumAPI['contributors']:
if artist['id'] != 5080 or artist['id'] == 5080 and settings['albumVariousArtists']: if artist['id'] != 5080 or artist['id'] == 5080 and settings['albumVariousArtists']:
track['album']['artists'].append(artist['name']) if artist['name'] not in track['album']['artists']:
if not artist['role'] in track['album']['artist']: track['album']['artists'].append(artist['name'])
track['album']['artist'][artist['role']] = []
if artist['role'] != "Main" and artist['name'] not in track['album']['artist']['Main'] or artist['role'] == "Main": if artist['role'] != "Main" and artist['name'] not in track['album']['artist']['Main'] or artist['role'] == "Main":
if not artist['role'] in track['album']['artist']:
track['album']['artist'][artist['role']] = []
track['album']['artist'][artist['role']].append(artist['name']) track['album']['artist'][artist['role']].append(artist['name'])
if settings['removeDuplicateArtists']: if settings['removeDuplicateArtists']:
track['album']['artists'] = uniqueArray(track['album']['artists']) track['album']['artists'] = uniqueArray(track['album']['artists'])
@ -363,10 +364,11 @@ def getTrackData(dz, trackAPI_gw, settings, trackAPI=None, albumAPI_gw=None, alb
track['artists'] = [] track['artists'] = []
for artist in trackAPI['contributors']: for artist in trackAPI['contributors']:
if artist['id'] != 5080 or artist['id'] == 5080 and len(trackAPI['contributors']) == 1: if artist['id'] != 5080 or artist['id'] == 5080 and len(trackAPI['contributors']) == 1:
track['artists'].append(artist['name']) if artist['name'] not in track['artists']:
if not artist['role'] in track['artist']: track['artists'].append(artist['name'])
track['artist'][artist['role']] = []
if artist['role'] != "Main" and artist['name'] not in track['artist']['Main'] or artist['role'] == "Main": if artist['role'] != "Main" and artist['name'] not in track['artist']['Main'] or artist['role'] == "Main":
if not artist['role'] in track['artist']:
track['artist'][artist['role']] = []
track['artist'][artist['role']].append(artist['name']) track['artist'][artist['role']].append(artist['name'])
if settings['removeDuplicateArtists']: if settings['removeDuplicateArtists']:
track['artists'] = uniqueArray(track['artists']) track['artists'] = uniqueArray(track['artists'])

View File

@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text()
setup( setup(
name="deemix", name="deemix",
version="1.1.17", version="1.1.19",
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",