Error handling for delete, but still not working :(

This commit is contained in:
xnappo 2015-03-20 15:42:12 -05:00
parent 4c5debaa1e
commit bb3f52ea51
2 changed files with 17 additions and 14 deletions

View file

@ -495,7 +495,9 @@ class LibrarySync():
#add all kodi episodes to a list with episodes for use later on to delete episodes
#the mediabrowser ID is set as uniqueID in the NFO... for some reason this has key 'unknown' in the json response
for episode in ReadKodiDB().getKodiEpisodes(tvshow,False,False):
show = ReadKodiDB().getKodiEpisodes(tvshow,False,False)
if show != None:
for episode in show:
dict = {'mbid': str(episode["uniqueid"]["unknown"]),'kodiid': str(episode["episodeid"])}
allKodiEpisodeIds.append(dict)

View file

@ -424,6 +424,7 @@ class WriteKodiDB():
utils.logMsg("deleting episode from Kodi library",episodeid)
json_response = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodeDetails", "params": { "episodeid": %i}, "properties" : ["file","episodeid"] }, "id": 1}' %(int(episodeid)))
if json_response != None and json_response != "" and json_response != []:
jsonobject = json.loads(json_response.decode('utf-8','replace'))
print jsonobject