From 4ac54ddb5f7a7d51d8f324ed08b8b1c3bf290b3f Mon Sep 17 00:00:00 2001 From: uh_wot <3631986-uh_wot@users.noreply.gitlab.com> Date: Thu, 16 Apr 2020 11:13:13 +0200 Subject: [PATCH 1/2] changed PNG image URL based on official android app --- deemix/app/downloader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deemix/app/downloader.py b/deemix/app/downloader.py index bb473cc..6b1aec1 100644 --- a/deemix/app/downloader.py +++ b/deemix/app/downloader.py @@ -468,7 +468,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None track['selectedFormat'] = format track['selectedFilesize'] = filesize track['album']['bitrate'] = format - track['album']['picUrl'] = "https://e-cdns-images.dzcdn.net/images/cover/{}/{}x{}-000000-80-0-0.{}".format(track['album']['pic'], settings['embeddedArtworkSize'], settings['embeddedArtworkSize'], 'png' if settings['PNGcovers'] else 'jpg') + track['album']['picUrl'] = "https://e-cdns-images.dzcdn.net/images/cover/{}/{}x{}-{}".format(track['album']['pic'], settings['embeddedArtworkSize'], settings['embeddedArtworkSize'], 'none-100-0-0.png' if settings['PNGcovers'] else '000000-80-0-0.jpg') track['dateString'] = formatDate(track['date'], settings['dateFormat']) track['album']['dateString'] = formatDate(track['album']['date'], settings['dateFormat']) @@ -535,7 +535,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None # Save artist art if artistPath: - result['artistURL'] = "https://e-cdns-images.dzcdn.net/images/artist/{}/{}x{}-000000-80-0-0.{}".format(track['album']['mainArtist']['pic'], settings['localArtworkSize'], settings['localArtworkSize'], 'png' if settings['PNGcovers'] else 'jpg') + result['artistURL'] = "https://e-cdns-images.dzcdn.net/images/artist/{}/{}x{}-{}".format(track['album']['mainArtist']['pic'], settings['localArtworkSize'], settings['localArtworkSize'], 'none-100-0-0.png' if settings['PNGcovers'] else '000000-80-0-0.jpg') result['artistPath'] = os.path.join(artistPath, f"{settingsRegexArtist(settings['artistImageTemplate'], track['album']['mainArtist'], settings)}.{'png' if settings['PNGcovers'] else 'jpg'}") # Data for m3u file From d59937b9bde8417bafd3d51cb9598bc2b576781c Mon Sep 17 00:00:00 2001 From: uh_wot <3631986-uh_wot@users.noreply.gitlab.com> Date: Thu, 16 Apr 2020 11:49:56 +0200 Subject: [PATCH 2/2] added JPEG image quality setting --- deemix/app/default.json | 1 + deemix/app/downloader.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deemix/app/default.json b/deemix/app/default.json index 18f29f0..22b6679 100644 --- a/deemix/app/default.json +++ b/deemix/app/default.json @@ -30,6 +30,7 @@ "saveArtworkArtist": false, "artistImageTemplate": "folder", "PNGcovers": false, + "jpegImageQuality": 80, "dateFormat": "Y-M-D", "savePlaylistAsCompilation": false, "removeAlbumVersion": false, diff --git a/deemix/app/downloader.py b/deemix/app/downloader.py index 6b1aec1..1a6a094 100644 --- a/deemix/app/downloader.py +++ b/deemix/app/downloader.py @@ -468,7 +468,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None track['selectedFormat'] = format track['selectedFilesize'] = filesize track['album']['bitrate'] = format - track['album']['picUrl'] = "https://e-cdns-images.dzcdn.net/images/cover/{}/{}x{}-{}".format(track['album']['pic'], settings['embeddedArtworkSize'], settings['embeddedArtworkSize'], 'none-100-0-0.png' if settings['PNGcovers'] else '000000-80-0-0.jpg') + track['album']['picUrl'] = "https://e-cdns-images.dzcdn.net/images/cover/{}/{}x{}-{}".format(track['album']['pic'], settings['embeddedArtworkSize'], settings['embeddedArtworkSize'], 'none-100-0-0.png' if settings['PNGcovers'] else f'000000-{settings["jpegImageQuality"]}-0-0.jpg') track['dateString'] = formatDate(track['date'], settings['dateFormat']) track['album']['dateString'] = formatDate(track['album']['date'], settings['dateFormat']) @@ -535,7 +535,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None # Save artist art if artistPath: - result['artistURL'] = "https://e-cdns-images.dzcdn.net/images/artist/{}/{}x{}-{}".format(track['album']['mainArtist']['pic'], settings['localArtworkSize'], settings['localArtworkSize'], 'none-100-0-0.png' if settings['PNGcovers'] else '000000-80-0-0.jpg') + result['artistURL'] = "https://e-cdns-images.dzcdn.net/images/artist/{}/{}x{}-{}".format(track['album']['mainArtist']['pic'], settings['localArtworkSize'], settings['localArtworkSize'], 'none-100-0-0.png' if settings['PNGcovers'] else f'000000-{settings["jpegImageQuality"]}-0-0.jpg') result['artistPath'] = os.path.join(artistPath, f"{settingsRegexArtist(settings['artistImageTemplate'], track['album']['mainArtist'], settings)}.{'png' if settings['PNGcovers'] else 'jpg'}") # Data for m3u file