From ca2b2745db5171dc510f5922764f7e5796f7548d Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Wed, 21 Oct 2015 02:40:02 -0500 Subject: [PATCH] Take into account coverart settings To disable coverart --- resources/lib/API.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/resources/lib/API.py b/resources/lib/API.py index acb692cd..52212311 100644 --- a/resources/lib/API.py +++ b/resources/lib/API.py @@ -394,10 +394,13 @@ class API(): maxHeight = 10000 maxWidth = 10000 - quality = "" + customquery = "" if utils.settings('compressArt') == "true": - quality = "&Quality=90" + customquery = "&Quality=90" + + if utils.settings('disableCoverArt') == "true": + customquery += "&EnableImageEnhancers=false" allartworks = { @@ -413,14 +416,14 @@ class API(): # Process backdrops backdropIndex = 0 for backdroptag in backdrops: - artwork = "%s/mediabrowser/Items/%s/Images/Backdrop/%s?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, id, backdropIndex, maxWidth, maxHeight, backdroptag, quality) + artwork = "%s/mediabrowser/Items/%s/Images/Backdrop/%s?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, id, backdropIndex, maxWidth, maxHeight, backdroptag, customquery) allartworks['Backdrop'].append(artwork) backdropIndex += 1 # Process the rest of the artwork for art in artworks: tag = artworks[art] - artwork = "%s/mediabrowser/Items/%s/Images/%s/0?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, id, art, maxWidth, maxHeight, tag, quality) + artwork = "%s/mediabrowser/Items/%s/Images/%s/0?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, id, art, maxWidth, maxHeight, tag, customquery) allartworks[art] = artwork # Process parent items if the main item is missing artwork @@ -436,7 +439,7 @@ class API(): backdropIndex = 0 for parentbackdroptag in parentbackdrops: - artwork = "%s/mediabrowser/Items/%s/Images/Backdrop/%s?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, parentId, backdropIndex, maxWidth, maxHeight, parentbackdroptag, quality) + artwork = "%s/mediabrowser/Items/%s/Images/Backdrop/%s?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, parentId, backdropIndex, maxWidth, maxHeight, parentbackdroptag, customquery) allartworks['Backdrop'].append(artwork) backdropIndex += 1 @@ -450,7 +453,7 @@ class API(): if parentId: parentTag = item['Parent%sImageTag' % parentart] - artwork = "%s/mediabrowser/Items/%s/Images/%s/0?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, parentId, parentart, maxWidth, maxHeight, parentTag, quality) + artwork = "%s/mediabrowser/Items/%s/Images/%s/0?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, parentId, parentart, maxWidth, maxHeight, parentTag, customquery) allartworks[parentart] = artwork # Parent album works a bit differently @@ -460,7 +463,7 @@ class API(): if parentId and item.get('AlbumPrimaryImageTag'): parentTag = item['AlbumPrimaryImageTag'] - artwork = "%s/mediabrowser/Items/%s/Images/Primary/0?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, parentId, maxWidth, maxHeight, parentTag, quality) + artwork = "%s/mediabrowser/Items/%s/Images/Primary/0?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, parentId, maxWidth, maxHeight, parentTag, customquery) allartworks['Primary'] = artwork