From 95db6e4b3fa3e786441a96b30d52feca975fa11f Mon Sep 17 00:00:00 2001 From: xnappo Date: Thu, 2 Apr 2015 22:37:09 -0500 Subject: [PATCH] Remove old delete code --- resources/lib/KodiMonitor.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/resources/lib/KodiMonitor.py b/resources/lib/KodiMonitor.py index 0754562d..1d2c06a6 100644 --- a/resources/lib/KodiMonitor.py +++ b/resources/lib/KodiMonitor.py @@ -96,33 +96,6 @@ class Kodi_Monitor(xbmc.Monitor): utils.logMsg("MB# Sync","Kodi_Monitor--> VideoLibrary.OnUpdate : " + str(data),2) WriteKodiDB().updatePlayCountFromKodi(item, type, playcount) - if method == "VideoLibrary.OnRemove": - xbmc.log('Intercepted remove from sender: ' + sender + ' method: ' + method + ' data: ' + data) - WINDOW = xbmcgui.Window( 10000 ) - if WINDOW.getProperty("suspendDeletes") == "True": - #This is a handshake to not try to delete if the item was removed from the Kodi DB due to sync - xbmc.log('Item deleted by sync') - WINDOW.setProperty("suspendDeletes", "False") - return - jsondata = json.loads(data) - if jsondata != None: - if jsondata.get("type") == "episode": - episodeid = jsondata.get("id") - MBlist = WINDOW.getProperty("episodeid" + str(episodeid)).split(";;") - #MBlist[0] is the ID, and [1] the title - url='http://' + server + '/mediabrowser/Items?Ids=' + MBlist[1] + '&format=json' - #This is a check to see if the item exists on the server, if it doesn't it may have already been deleted by another client - data = DownloadUtils().downloadUrl(url=url, suppress=True, popup=0) - result = json.loads(data) - item = result.get("Items")[0] - if WINDOW.getProperty("embyid" + item.get("Id")) == "deleted": - xbmc.log('Item was already deleted: ' + str(MBlist)) - elif data != "": - return_value = xbmcgui.Dialog().yesno("Confirm Delete", "Delete: "+ MBlist[0] + "\n on Emby Server?") - if return_value: - url='http://' + server + '/mediabrowser/Items/' + MBlist[1] - xbmc.log('Deleting via URL: ' + url) - DownloadUtils().downloadUrl(url, type="DELETE")