Adding episode delete (for real this time!)

This commit is contained in:
xnappo 2015-03-24 18:52:23 -05:00
parent b97dadbd9c
commit 0f35f73f76
2 changed files with 9 additions and 8 deletions

View file

@ -270,8 +270,6 @@ class DownloadUtils():
self.logMsg("No auth info set and suppress is true so returning no data!") self.logMsg("No auth info set and suppress is true so returning no data!")
return "" return ""
suppress = False
self.TotalUrlCalls = self.TotalUrlCalls + 1 self.TotalUrlCalls = self.TotalUrlCalls + 1
if(self.LogCalls): if(self.LogCalls):
stackString = "" stackString = ""

View file

@ -20,6 +20,7 @@ class Kodi_Monitor(xbmc.Monitor):
pass pass
#this library monitor is used to detect a watchedstate change by the user through the library #this library monitor is used to detect a watchedstate change by the user through the library
#as well as detect when a library item has been deleted to pass the delete to the Emby server
def onNotification (self,sender,method,data): def onNotification (self,sender,method,data):
addon = xbmcaddon.Addon(id='plugin.video.mb3sync') addon = xbmcaddon.Addon(id='plugin.video.mb3sync')
port = addon.getSetting('port') port = addon.getSetting('port')
@ -45,12 +46,14 @@ class Kodi_Monitor(xbmc.Monitor):
episodeid = jsondata.get("id") episodeid = jsondata.get("id")
WINDOW = xbmcgui.Window( 10000 ) WINDOW = xbmcgui.Window( 10000 )
MBlist = WINDOW.getProperty("episodeid" + str(episodeid)).split(";;") MBlist = WINDOW.getProperty("episodeid" + str(episodeid)).split(";;")
#NEED TO CHECK IF ITEM STILL EXISTS ON EMBY SERVER 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")