fix delete TV Show

This commit is contained in:
shaun 2015-04-02 19:00:58 +11:00
parent 6f11368575
commit 685cf9ae81
2 changed files with 7 additions and 4 deletions

View file

@ -569,7 +569,7 @@ class LibrarySync():
allMB3TVShows = set(allTVShows)
for show in allKodiShows:
if not show in allMB3TVShows:
WriteKodiDB().deleteTVShowFromKodiLibrary(dir)
WriteKodiDB().deleteTVShowFromKodiLibrary(show)
totalItemsDeleted += 1
if(self.ShouldStop(pDialog)):

View file

@ -1063,13 +1063,16 @@ class WriteKodiDB():
finally:
cursor.close()
def deleteTVShowFromKodiLibrary(self, id ):
def deleteTVShowFromKodiLibrary(self, id):
xbmc.sleep(sleepVal)
kodiItem = ReadKodiDB().getKodiTVShow(id)
utils.logMsg("deleting tvshow from Kodi library",id)
utils.logMsg("deleting tvshow from Kodi library ", "Emby ID : " + id)
if kodiItem != None:
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.RemoveTVShow", "params": { "tvshowid": %i}, "id": 1 }' %(kodiItem["tvshowid"]))
utils.logMsg("deleting tvshow from Kodi library ", str(kodiItem))
kodiId = kodiItem["tvshowid"]
utils.logMsg("deleting tvshow from Kodi library ", "Kodi ID : " + str(kodiId))
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.RemoveTVShow", "params": { "tvshowid": %i}, "id": 1 }' %(kodiId))
def updateSeasons(self,MBitem, KodiItem):
#use sqlite to set the season details because no method in API available for this