mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
optimize getArt method --> small fixes and removed extra logging
This commit is contained in:
parent
7f7127b3bc
commit
58ad5c1fe3
1 changed files with 4 additions and 6 deletions
|
@ -277,7 +277,6 @@ class WriteKodiDB():
|
|||
id = KodiItem['movieid']
|
||||
jsoncommand = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetMovieDetails", "params": { "movieid": %i, "art": %s}, "id": 1 }'
|
||||
|
||||
|
||||
#update artwork
|
||||
changes = False
|
||||
|
||||
|
@ -290,11 +289,11 @@ class WriteKodiDB():
|
|||
artwork["discart"] = API().getArtwork(MBitem, "Disc")
|
||||
artwork["fanart"] = API().getArtwork(MBitem, "Backdrop")
|
||||
|
||||
|
||||
for art in artwork:
|
||||
if artwork.get(art) != None:
|
||||
if artwork.get(art) != "":
|
||||
if KodiItem["art"].has_key(art):
|
||||
if KodiItem["art"][art] != artwork.get(art):
|
||||
curValue = urllib.unquote(KodiItem['art'][art]).decode('utf8')
|
||||
if not artwork.get(art) in curValue:
|
||||
KodiItem["art"][art] = artwork.get(art)
|
||||
changes = True
|
||||
else:
|
||||
|
@ -307,7 +306,6 @@ class WriteKodiDB():
|
|||
if changes:
|
||||
json_array = json.dumps(KodiItem["art"])
|
||||
result = xbmc.executeJSONRPC(jsoncommand %(id, json_array))
|
||||
print result
|
||||
return changes
|
||||
|
||||
# adds or updates the given property on the videofile in Kodi database
|
||||
|
|
Loading…
Reference in a new issue