diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index 8ad461d9..cc04d2e7 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -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)): diff --git a/resources/lib/WriteKodiDB.py b/resources/lib/WriteKodiDB.py index 8af5885a..57cdb4cf 100644 --- a/resources/lib/WriteKodiDB.py +++ b/resources/lib/WriteKodiDB.py @@ -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