mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
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 = connection.cursor()
|
||||||
cursor.execute("DELETE FROM emby WHERE emby_id = ?", (id,))
|
cursor.execute("DELETE FROM emby WHERE emby_id = ?", (id,))
|
||||||
connection.commit()
|
connection.commit()
|
||||||
|
cursor.close
|
||||||
|
|
||||||
if jsondata != None:
|
if jsondata:
|
||||||
if jsondata.get("type") == "episode":
|
if jsondata.get("type") == "episode":
|
||||||
url='{server}/mediabrowser/Items?Ids=' + id + '&format=json'
|
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
|
#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)
|
result = DownloadUtils().downloadUrl(url)
|
||||||
item = result.get("Items")[0]
|
item = result.get("Items")[0]
|
||||||
if data != "":
|
if data:
|
||||||
return_value = xbmcgui.Dialog().yesno("Confirm Delete", "Delete file on Emby Server?")
|
return_value = xbmcgui.Dialog().yesno("Confirm Delete", "Delete file on Emby Server?")
|
||||||
if return_value:
|
if return_value:
|
||||||
url='{server}/mediabrowser/Items/' + id
|
url='{server}/mediabrowser/Items/' + id
|
||||||
|
|
Loading…
Reference in a new issue