fixed false positive deletion warning on library updates in kodimonitor thread
This commit is contained in:
parent
824cd6bef0
commit
6b004564bf
2 changed files with 13 additions and 9 deletions
|
@ -45,6 +45,8 @@ class Kodi_Monitor(xbmc.Monitor):
|
|||
if jsondata.get("type") == "episode":
|
||||
episodeid = jsondata.get("id")
|
||||
WINDOW = xbmcgui.Window( 10000 )
|
||||
#ignore if the item has just been deleted by the background sync
|
||||
if not WINDOW.getProperty(episodeid,"deleted"):
|
||||
MBlist = WINDOW.getProperty("episodeid" + str(episodeid)).split(";;")
|
||||
url='http://' + server + '/mediabrowser/Items?Ids=' + MBlist[1] + '&format=json'
|
||||
data = DownloadUtils().downloadUrl(url=url, suppress=True, popup=0)
|
||||
|
|
|
@ -215,6 +215,7 @@ class LibrarySync():
|
|||
allEmbyMovieIds = set(allEmbyMovieIds)
|
||||
for kodiId in allKodiIds:
|
||||
if not kodiId in allEmbyMovieIds:
|
||||
WINDOW.setProperty(kodiId,"deleted")
|
||||
WriteKodiDB().deleteMovieFromKodiLibrary(kodiId)
|
||||
cleanNeeded = True
|
||||
totalItemsDeleted += 1
|
||||
|
@ -567,6 +568,7 @@ class LibrarySync():
|
|||
allMB3EpisodeIds = set(allMB3EpisodeIds)
|
||||
for episode in allKodiEpisodeIds:
|
||||
if episode.get('episodeid') not in allMB3EpisodeIds:
|
||||
WINDOW.setProperty(episode.get('episodeid'),"deleted")
|
||||
WriteKodiDB().deleteEpisodeFromKodiLibrary(episode.get('episodeid'),episode.get('tvshowid'))
|
||||
cleanneeded = True
|
||||
totalItemsDeleted += 1
|
||||
|
|
Loading…
Reference in a new issue