From e781e9e02d8c37b2aa65b358c3abda9e20e9937b Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Wed, 14 Oct 2015 08:46:46 -0500 Subject: [PATCH] Add parent album to artwork For parent images --- resources/lib/API.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/resources/lib/API.py b/resources/lib/API.py index 877be5f0..acb692cd 100644 --- a/resources/lib/API.py +++ b/resources/lib/API.py @@ -428,6 +428,7 @@ class API(): # Process backdrops if not allartworks['Backdrop']: + parentId = item.get('ParentBackdropItemId') if parentId: # If there is a parentId, go through the parent backdrop list @@ -444,12 +445,25 @@ class API(): for parentart in parentartwork: if not allartworks[parentart]: + parentId = item.get('Parent%sItemId' % parentart) 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) allartworks[parentart] = artwork + # Parent album works a bit differently + if not allartworks['Primary']: + + parentId = item.get('AlbumId') + 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) + allartworks['Primary'] = artwork + + return allartworks def getArtwork(self, data, type, mediaType = "", index = "0", userParentInfo = False):