From ffb803cf3c0cdaeca2490e96a8d0bf804e9483bc Mon Sep 17 00:00:00 2001 From: RemixDev Date: Thu, 30 Jul 2020 19:37:10 +0200 Subject: [PATCH] Fixed playlist cover downloading and spotify playlist size This fixes #8 again --- deemix/__init__.py | 2 +- deemix/app/downloader.py | 2 +- deemix/app/spotify.py | 1 + setup.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/deemix/__init__.py b/deemix/__init__.py index 4336d29..f84fe98 100644 --- a/deemix/__init__.py +++ b/deemix/__init__.py @@ -1,3 +1,3 @@ #!/usr/bin/env python3 -__version__ = "1.1.25" +__version__ = "1.1.26" diff --git a/deemix/app/downloader.py b/deemix/app/downloader.py index bcb4311..b5b3525 100644 --- a/deemix/app/downloader.py +++ b/deemix/app/downloader.py @@ -1031,7 +1031,7 @@ def after_download(tracks, settings, queueItem): with open(os.path.join(extrasPath, 'errors.txt'), 'wb') as f: f.write(errors.encode('utf-8')) if settings['saveArtwork'] and playlistCover and not settings['tags']['savePlaylistAsCompilation']: - for image in result['playlistURLs']: + for image in playlistURLs: downloadImage(image['url'], os.path.join(extrasPath, playlistCover)+f".{image['ext']}", settings['overwriteFile']) if settings['logSearched'] and searched != "": with open(os.path.join(extrasPath, 'searched.txt'), 'wb') as f: diff --git a/deemix/app/spotify.py b/deemix/app/spotify.py index 19d2d70..16ee8a6 100644 --- a/deemix/app/spotify.py +++ b/deemix/app/spotify.py @@ -205,6 +205,7 @@ class SpotifyHelper: if item['track']: tracklist.append(item['track']) totalSize = len(tracklist) + result['size'] = totalSize if path.isfile(path.join(self.configFolder, 'spotifyCache.json')): with open(path.join(self.configFolder, 'spotifyCache.json'), 'r') as spotifyCache: cache = json.load(spotifyCache) diff --git a/setup.py b/setup.py index a9dceef..7f6af46 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text() setup( name="deemix", - version="1.1.25", + version="1.1.26", description="A barebone deezer downloader library", long_description=README, long_description_content_type="text/markdown",