mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-13 21:56:11 +00:00
Fix artwork cache
Still looking into the delay with extra fanart scenario
This commit is contained in:
parent
f472f44a40
commit
493459de33
1 changed files with 47 additions and 44 deletions
|
@ -103,7 +103,7 @@ class Artwork():
|
||||||
result = xbmc.executeJSONRPC(json.dumps(web_user))
|
result = xbmc.executeJSONRPC(json.dumps(web_user))
|
||||||
self.xbmc_username = "kodi"
|
self.xbmc_username = "kodi"
|
||||||
|
|
||||||
else:
|
|
||||||
# Webserver already enabled
|
# Webserver already enabled
|
||||||
web_port = {
|
web_port = {
|
||||||
|
|
||||||
|
@ -116,6 +116,7 @@ class Artwork():
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = xbmc.executeJSONRPC(json.dumps(web_port))
|
result = xbmc.executeJSONRPC(json.dumps(web_port))
|
||||||
|
result = json.loads(result)
|
||||||
try:
|
try:
|
||||||
self.xbmc_port = result['result']['value']
|
self.xbmc_port = result['result']['value']
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
@ -132,6 +133,7 @@ class Artwork():
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = xbmc.executeJSONRPC(json.dumps(web_user))
|
result = xbmc.executeJSONRPC(json.dumps(web_user))
|
||||||
|
result = json.loads(result)
|
||||||
try:
|
try:
|
||||||
self.xbmc_username = result['result']['value']
|
self.xbmc_username = result['result']['value']
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
@ -148,6 +150,7 @@ class Artwork():
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = xbmc.executeJSONRPC(json.dumps(web_pass))
|
result = xbmc.executeJSONRPC(json.dumps(web_pass))
|
||||||
|
result = json.loads(result)
|
||||||
try:
|
try:
|
||||||
self.xbmc_password = result['result']['value']
|
self.xbmc_password = result['result']['value']
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
@ -315,13 +318,13 @@ class Artwork():
|
||||||
cacheimage = True
|
cacheimage = True
|
||||||
self.logMsg("Adding Art Link for kodiId: %s (%s)" % (kodiId, imageUrl), 2)
|
self.logMsg("Adding Art Link for kodiId: %s (%s)" % (kodiId, imageUrl), 2)
|
||||||
|
|
||||||
query = ' '.join((
|
query = (
|
||||||
|
'''
|
||||||
|
INSERT INTO art(media_id, media_type, type, url)
|
||||||
|
|
||||||
"INSERT INTO art(",
|
VALUES (?, ?, ?, ?)
|
||||||
"media_id, media_type, type, url)",
|
'''
|
||||||
|
)
|
||||||
"VALUES (?, ?, ?, ?)"
|
|
||||||
))
|
|
||||||
cursor.execute(query, (kodiId, mediaType, imageType, imageUrl))
|
cursor.execute(query, (kodiId, mediaType, imageType, imageUrl))
|
||||||
|
|
||||||
else: # Only cache artwork if it changed
|
else: # Only cache artwork if it changed
|
||||||
|
|
Loading…
Reference in a new issue