From 4d77401512ed938d7caee29e6ab0afa07cad95f8 Mon Sep 17 00:00:00 2001 From: xnappo Date: Fri, 8 May 2015 19:01:25 -0500 Subject: [PATCH] Close database after delete --- resources/lib/KodiMonitor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/lib/KodiMonitor.py b/resources/lib/KodiMonitor.py index 954fd6ab..d0884da5 100644 --- a/resources/lib/KodiMonitor.py +++ b/resources/lib/KodiMonitor.py @@ -67,14 +67,15 @@ class Kodi_Monitor(xbmc.Monitor): cursor = connection.cursor() cursor.execute("DELETE FROM emby WHERE emby_id = ?", (id,)) connection.commit() + cursor.close - if jsondata != None: + if jsondata: if jsondata.get("type") == "episode": url='{server}/mediabrowser/Items?Ids=' + id + '&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 result = DownloadUtils().downloadUrl(url) item = result.get("Items")[0] - if data != "": + if data: return_value = xbmcgui.Dialog().yesno("Confirm Delete", "Delete file on Emby Server?") if return_value: url='{server}/mediabrowser/Items/' + id