Close database after delete
This commit is contained in:
parent
e2b952911f
commit
4d77401512
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue