added JPEG image quality setting

This commit is contained in:
uh_wot 2020-04-16 11:49:56 +02:00
parent 4ac54ddb5f
commit d59937b9bd
2 changed files with 3 additions and 2 deletions

View File

@ -30,6 +30,7 @@
"saveArtworkArtist": false, "saveArtworkArtist": false,
"artistImageTemplate": "folder", "artistImageTemplate": "folder",
"PNGcovers": false, "PNGcovers": false,
"jpegImageQuality": 80,
"dateFormat": "Y-M-D", "dateFormat": "Y-M-D",
"savePlaylistAsCompilation": false, "savePlaylistAsCompilation": false,
"removeAlbumVersion": false, "removeAlbumVersion": false,

View File

@ -468,7 +468,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
track['selectedFormat'] = format track['selectedFormat'] = format
track['selectedFilesize'] = filesize track['selectedFilesize'] = filesize
track['album']['bitrate'] = format 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['dateString'] = formatDate(track['date'], settings['dateFormat'])
track['album']['dateString'] = formatDate(track['album']['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 # Save artist art
if artistPath: 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'}") result['artistPath'] = os.path.join(artistPath, f"{settingsRegexArtist(settings['artistImageTemplate'], track['album']['mainArtist'], settings)}.{'png' if settings['PNGcovers'] else 'jpg'}")
# Data for m3u file # Data for m3u file