mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
Force refresh fanart
The only thing cached into texture13.db I believe fanart was the last thing that wasn't changing when modified in Emby.
This commit is contained in:
parent
ae07e1b4c6
commit
142908d56d
3 changed files with 18 additions and 1 deletions
|
@ -73,6 +73,18 @@ class TextureCache():
|
|||
except:
|
||||
#extreme short timeouts so we will have a exception, but we don't need the result so pass
|
||||
pass
|
||||
|
||||
def refreshFanart(self,url):
|
||||
connection = utils.KodiSQL("texture")
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("SELECT cachedurl FROM texture WHERE url = ?", (url,))
|
||||
result = cursor.fetchone()
|
||||
if result:
|
||||
cursor.execute("DELETE FROM texture WHERE url = ?", (url,))
|
||||
connection.commit()
|
||||
else:
|
||||
self.CacheTexture(url)
|
||||
cursor.close()
|
||||
|
||||
|
||||
def setKodiWebServerDetails(self):
|
||||
|
|
|
@ -54,6 +54,8 @@ def KodiSQL(type="video"):
|
|||
|
||||
if type == "music":
|
||||
dbPath = getKodiMusicDBPath()
|
||||
elif type == "texture":
|
||||
dbPath = xbmc.translatePath("special://database/Textures13.db")
|
||||
else:
|
||||
dbPath = getKodiVideoDBPath()
|
||||
|
||||
|
|
|
@ -796,7 +796,10 @@ class WriteKodiVideoDB():
|
|||
cursor.execute("UPDATE art set url = ? WHERE media_id = ? AND media_type = ? AND type = ?", (imageUrl, kodiId, mediaType, imageType))
|
||||
|
||||
#cache fanart and poster in Kodi texture cache
|
||||
if imageType == "fanart" or imageType == "poster":
|
||||
if "fanart" in imageType:
|
||||
utils.logMsg("ArtworkSync", "Adding or Updating Fanart: %s" % imageUrl)
|
||||
self.textureCache.refreshFanart(imageUrl)
|
||||
elif "poster" in imageType:
|
||||
self.textureCache.CacheTexture(imageUrl)
|
||||
|
||||
def setKodiResumePoint(self, fileid, resume_seconds, total_seconds, cursor):
|
||||
|
|
Loading…
Reference in a new issue