This commit is contained in:
Croneter 2018-06-15 14:07:53 +02:00
parent 210701c366
commit c580638fb5

View file

@ -511,22 +511,22 @@ def extra_fanart(plex_id, plex_path):
backdrops = api.artwork()['Backdrop'] backdrops = api.artwork()['Backdrop']
for count, backdrop in enumerate(backdrops): for count, backdrop in enumerate(backdrops):
# Same ordering as in artwork # Same ordering as in artwork
fanartFile = try_encode(join(fanart_dir, "fanart%.3d.jpg" % count)) art_file = try_encode(join(fanart_dir, "fanart%.3d.jpg" % count))
li = ListItem("%.3d" % count, path=fanartFile) li = ListItem("%.3d" % count, path=art_file)
xbmcplugin.addDirectoryItem( xbmcplugin.addDirectoryItem(
handle=HANDLE, handle=HANDLE,
url=fanartFile, url=art_file,
listitem=li) listitem=li)
copyfile(backdrop, try_decode(fanartFile)) copyfile(backdrop, try_decode(art_file))
else: else:
LOG.info("Found cached backdrop.") LOG.info("Found cached backdrop.")
# Use existing cached images # Use existing cached images
for root, dirs, files in walk(fanart_dir): for root, dirs, files in walk(fanart_dir):
for file in files: for file in files:
fanartFile = try_encode(join(root, file)) art_file = try_encode(join(root, file))
li = ListItem(file, path=fanartFile) li = ListItem(file, path=art_file)
xbmcplugin.addDirectoryItem(handle=HANDLE, xbmcplugin.addDirectoryItem(handle=HANDLE,
url=fanartFile, url=art_file,
listitem=li) listitem=li)
xbmcplugin.endOfDirectory(HANDLE) xbmcplugin.endOfDirectory(HANDLE)