New fix item episode thumbs not caching

This commit is contained in:
tomkat83 2016-03-14 11:47:14 +01:00
parent f060a71237
commit d01cf199e5
3 changed files with 18 additions and 6 deletions

View file

@ -3,7 +3,6 @@ from urllib import urlencode
from ast import literal_eval
from urlparse import urlparse, parse_qs
import re
import time
from xbmcaddon import Addon

View file

@ -421,7 +421,7 @@ class Artwork():
cursor.execute(query, (imageUrl, kodiId, mediaType, imageType))
# Cache fanart and poster in Kodi texture cache
if cacheimage and imageType in ("fanart", "poster"):
if cacheimage and imageType in ("fanart", "poster", "thumb"):
self.CacheTexture(imageUrl)
def deleteArtwork(self, kodiid, mediatype, cursor):

View file

@ -43,6 +43,8 @@ class Items(object):
self.artwork = artwork.Artwork()
self.emby = embyserver.Read_EmbyServer()
self.userid = utils.window('currUserId')
self.server = utils.window('pms_server')
def __enter__(self):
"""
@ -1445,8 +1447,21 @@ class TVShows(Items):
people = API.getPeopleList()
kodi_db.addPeople(episodeid, people, "episode")
# Process artwork
artworks = API.getAllArtwork()
artwork.addOrUpdateArt(artworks['Primary'], episodeid, "episode", "thumb", kodicursor)
# Wide "screenshot" of particular episode
poster = item.attrib.get('thumb')
if poster:
poster = API.addPlexCredentialsToUrl(
"%s%s" % (self.server, poster))
artwork.addOrUpdateArt(
poster, episodeid, "episode", "thumb", kodicursor)
# poster of TV show itself
# poster = item.attrib.get('grandparentThumb')
# if poster:
# poster = API.addPlexCredentialsToUrl(
# "%s%s" % (self.server, poster))
# artwork.addOrUpdateArt(
# poster, episodeid, "episode", "poster", kodicursor)
# Process stream details
streams = API.getMediaStreams()
kodi_db.addStreams(fileid, streams, runtime)
@ -1609,8 +1624,6 @@ class Music(Items):
self.enableimportsongrating = utils.settings('enableImportSongRating') == "true"
self.enableexportsongrating = utils.settings('enableExportSongRating') == "true"
self.enableupdatesongrating = utils.settings('enableUpdateSongRating') == "true"
self.userid = utils.window('currUserId')
self.server = utils.window('pms_server')
def __enter__(self):
"""