mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
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,15 +45,17 @@ class Kodi_Monitor(xbmc.Monitor):
|
||||||
if jsondata.get("type") == "episode":
|
if jsondata.get("type") == "episode":
|
||||||
episodeid = jsondata.get("id")
|
episodeid = jsondata.get("id")
|
||||||
WINDOW = xbmcgui.Window( 10000 )
|
WINDOW = xbmcgui.Window( 10000 )
|
||||||
MBlist = WINDOW.getProperty("episodeid" + str(episodeid)).split(";;")
|
#ignore if the item has just been deleted by the background sync
|
||||||
url='http://' + server + '/mediabrowser/Items?Ids=' + MBlist[1] + '&format=json'
|
if not WINDOW.getProperty(episodeid,"deleted"):
|
||||||
data = DownloadUtils().downloadUrl(url=url, suppress=True, popup=0)
|
MBlist = WINDOW.getProperty("episodeid" + str(episodeid)).split(";;")
|
||||||
if data != "":
|
url='http://' + server + '/mediabrowser/Items?Ids=' + MBlist[1] + '&format=json'
|
||||||
return_value = xbmcgui.Dialog().yesno("Confirm Delete", "Delete: "+ MBlist[0] + "\n on Emby Server?\nEmbyID: " + MBlist[1])
|
data = DownloadUtils().downloadUrl(url=url, suppress=True, popup=0)
|
||||||
if return_value:
|
if data != "":
|
||||||
url='http://' + server + '/mediabrowser/Items/' + MBlist[1]
|
return_value = xbmcgui.Dialog().yesno("Confirm Delete", "Delete: "+ MBlist[0] + "\n on Emby Server?\nEmbyID: " + MBlist[1])
|
||||||
xbmc.log('Deleting via URL: ' + url)
|
if return_value:
|
||||||
DownloadUtils().downloadUrl(url, type="DELETE")
|
url='http://' + server + '/mediabrowser/Items/' + MBlist[1]
|
||||||
|
xbmc.log('Deleting via URL: ' + url)
|
||||||
|
DownloadUtils().downloadUrl(url, type="DELETE")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -215,6 +215,7 @@ class LibrarySync():
|
||||||
allEmbyMovieIds = set(allEmbyMovieIds)
|
allEmbyMovieIds = set(allEmbyMovieIds)
|
||||||
for kodiId in allKodiIds:
|
for kodiId in allKodiIds:
|
||||||
if not kodiId in allEmbyMovieIds:
|
if not kodiId in allEmbyMovieIds:
|
||||||
|
WINDOW.setProperty(kodiId,"deleted")
|
||||||
WriteKodiDB().deleteMovieFromKodiLibrary(kodiId)
|
WriteKodiDB().deleteMovieFromKodiLibrary(kodiId)
|
||||||
cleanNeeded = True
|
cleanNeeded = True
|
||||||
totalItemsDeleted += 1
|
totalItemsDeleted += 1
|
||||||
|
@ -567,6 +568,7 @@ class LibrarySync():
|
||||||
allMB3EpisodeIds = set(allMB3EpisodeIds)
|
allMB3EpisodeIds = set(allMB3EpisodeIds)
|
||||||
for episode in allKodiEpisodeIds:
|
for episode in allKodiEpisodeIds:
|
||||||
if episode.get('episodeid') not in allMB3EpisodeIds:
|
if episode.get('episodeid') not in allMB3EpisodeIds:
|
||||||
|
WINDOW.setProperty(episode.get('episodeid'),"deleted")
|
||||||
WriteKodiDB().deleteEpisodeFromKodiLibrary(episode.get('episodeid'),episode.get('tvshowid'))
|
WriteKodiDB().deleteEpisodeFromKodiLibrary(episode.get('episodeid'),episode.get('tvshowid'))
|
||||||
cleanneeded = True
|
cleanneeded = True
|
||||||
totalItemsDeleted += 1
|
totalItemsDeleted += 1
|
||||||
|
|
Loading…
Reference in a new issue