enumerate over backdrops

This commit is contained in:
angelblue05 2016-03-12 15:14:07 -06:00
parent 8072c8f7b2
commit 4af994ed74
1 changed files with 6 additions and 12 deletions

View File

@ -511,7 +511,7 @@ class Artwork():
server = self.server server = self.server
id = item['Id'] itemid = item['Id']
artworks = item['ImageTags'] artworks = item['ImageTags']
backdrops = item.get('BackdropImageTags',[]) backdrops = item.get('BackdropImageTags',[])
@ -537,15 +537,12 @@ class Artwork():
} }
# Process backdrops # Process backdrops
backdropIndex = 0 for index, tag in enumerate(backdrops):
for backdroptag in backdrops:
artwork = ( artwork = (
"%s/emby/Items/%s/Images/Backdrop/%s?" "%s/emby/Items/%s/Images/Backdrop/%s?"
"MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" "MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s"
% (server, id, backdropIndex, % (server, itemid, index, maxWidth, maxHeight, tag, customquery))
maxWidth, maxHeight, backdroptag, customquery))
allartworks['Backdrop'].append(artwork) allartworks['Backdrop'].append(artwork)
backdropIndex += 1
# Process the rest of the artwork # Process the rest of the artwork
for art in artworks: for art in artworks:
@ -555,7 +552,7 @@ class Artwork():
artwork = ( artwork = (
"%s/emby/Items/%s/Images/%s/0?" "%s/emby/Items/%s/Images/%s/0?"
"MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" "MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s"
% (server, id, art, maxWidth, maxHeight, tag, customquery)) % (server, itemid, art, maxWidth, maxHeight, tag, customquery))
allartworks[art] = artwork allartworks[art] = artwork
# Process parent items if the main item is missing artwork # Process parent items if the main item is missing artwork
@ -569,15 +566,12 @@ class Artwork():
# If there is a parentId, go through the parent backdrop list # If there is a parentId, go through the parent backdrop list
parentbackdrops = item['ParentBackdropImageTags'] parentbackdrops = item['ParentBackdropImageTags']
backdropIndex = 0 for index, tag in enumerate(parentbackdrops):
for parentbackdroptag in parentbackdrops:
artwork = ( artwork = (
"%s/emby/Items/%s/Images/Backdrop/%s?" "%s/emby/Items/%s/Images/Backdrop/%s?"
"MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" "MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s"
% (server, parentId, backdropIndex, % (server, parentId, index, maxWidth, maxHeight, tag, customquery))
maxWidth, maxHeight, parentbackdroptag, customquery))
allartworks['Backdrop'].append(artwork) allartworks['Backdrop'].append(artwork)
backdropIndex += 1
# Process the rest of the artwork # Process the rest of the artwork
parentartwork = ['Logo', 'Art', 'Thumb'] parentartwork = ['Logo', 'Art', 'Thumb']