mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
getAllArtwork
Get all the artwork for an item at once.
This commit is contained in:
parent
8f75f96909
commit
43494ec053
1 changed files with 39 additions and 33 deletions
|
@ -375,49 +375,55 @@ class API():
|
||||||
|
|
||||||
return mpaa
|
return mpaa
|
||||||
|
|
||||||
def getArtworks(self, data, type, mediaType = "", index = "0", getAll = False):
|
def getAllArtwork(self, item):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Get all artwork, it will return an empty string
|
Get all artwork, it will return an empty string
|
||||||
for the artwork type not found.
|
for the artwork type not found.
|
||||||
|
|
||||||
Index only matters when getAll is False.
|
Artwork type: Primary, Art, Banner, Logo, Thumb,
|
||||||
|
Disc, Backdrop
|
||||||
|
"""
|
||||||
|
|
||||||
mediaType: movie, boxset, tvshow, episode, season
|
username = utils.window('currUser')
|
||||||
|
server = utils.window('server%s' % username)
|
||||||
|
|
||||||
Artwork type: Primary, Banner, Logo, Art, Thumb,
|
id = item['Id']
|
||||||
Disc Backdrop
|
artworks = item['ImageTags']
|
||||||
"""
|
backdrops = item['BackdropImageTags']
|
||||||
id = data['Id']
|
|
||||||
|
|
||||||
maxHeight = 10000
|
maxHeight = 10000
|
||||||
maxWidth = 10000
|
maxWidth = 10000
|
||||||
imageTag = "e3ab56fe27d389446754d0fb04910a34" # Place holder tag
|
quality = ""
|
||||||
|
|
||||||
|
if utils.settings('compressArt') == "true":
|
||||||
|
quality = "&Quality=90"
|
||||||
|
|
||||||
if getAll:
|
allartworks = {
|
||||||
|
|
||||||
allartworks = {
|
'Primary': "",
|
||||||
|
'Art': "",
|
||||||
|
'Banner': "",
|
||||||
|
'Logo': "",
|
||||||
|
'Thumb': "",
|
||||||
|
'Disc': "",
|
||||||
|
'Backdrop': []
|
||||||
|
}
|
||||||
|
|
||||||
'Primary': "",
|
# Process backdrops
|
||||||
'Banner': "",
|
backdropIndex = 0
|
||||||
'Logo': "",
|
for backdroptag in backdrops:
|
||||||
'Art': "",
|
artwork = "%s/mediabrowser/Items/%s/Images/Backdrop/%s?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, id, backdropIndex, maxWidth, maxHeight, backdroptag, quality)
|
||||||
'Thumb': "",
|
allartworks['Backdrop'].append(artwork)
|
||||||
'Disc': "",
|
backdropIndex += 1
|
||||||
'Backdrop': ""
|
|
||||||
}
|
|
||||||
|
|
||||||
for keytype in allartworks:
|
# Process the rest of the artwork
|
||||||
type = keytype
|
for art in artworks:
|
||||||
url = ""
|
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)
|
||||||
|
allartworks[art] = artwork
|
||||||
|
|
||||||
allartworks[keytype] = url
|
return allartworks
|
||||||
|
|
||||||
|
|
||||||
return allartworks
|
|
||||||
|
|
||||||
else: pass
|
|
||||||
|
|
||||||
def getArtwork(self, data, type, mediaType = "", index = "0", userParentInfo = False):
|
def getArtwork(self, data, type, mediaType = "", index = "0", userParentInfo = False):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue