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))
|
||||
self.xbmc_username = "kodi"
|
||||
|
||||
else:
|
||||
|
||||
# Webserver already enabled
|
||||
web_port = {
|
||||
|
||||
|
@ -116,6 +116,7 @@ class Artwork():
|
|||
}
|
||||
}
|
||||
result = xbmc.executeJSONRPC(json.dumps(web_port))
|
||||
result = json.loads(result)
|
||||
try:
|
||||
self.xbmc_port = result['result']['value']
|
||||
except TypeError:
|
||||
|
@ -132,6 +133,7 @@ class Artwork():
|
|||
}
|
||||
}
|
||||
result = xbmc.executeJSONRPC(json.dumps(web_user))
|
||||
result = json.loads(result)
|
||||
try:
|
||||
self.xbmc_username = result['result']['value']
|
||||
except TypeError:
|
||||
|
@ -148,6 +150,7 @@ class Artwork():
|
|||
}
|
||||
}
|
||||
result = xbmc.executeJSONRPC(json.dumps(web_pass))
|
||||
result = json.loads(result)
|
||||
try:
|
||||
self.xbmc_password = result['result']['value']
|
||||
except TypeError:
|
||||
|
@ -315,13 +318,13 @@ class Artwork():
|
|||
cacheimage = True
|
||||
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(",
|
||||
"media_id, media_type, type, url)",
|
||||
|
||||
"VALUES (?, ?, ?, ?)"
|
||||
))
|
||||
VALUES (?, ?, ?, ?)
|
||||
'''
|
||||
)
|
||||
cursor.execute(query, (kodiId, mediaType, imageType, imageUrl))
|
||||
|
||||
else: # Only cache artwork if it changed
|
||||
|
|
Loading…
Reference in a new issue