mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Fix delete
Remove verification - option is only for deletion after playback.
This commit is contained in:
parent
9d82754882
commit
445469302f
1 changed files with 22 additions and 34 deletions
|
@ -148,40 +148,28 @@ class KodiMonitor(xbmc.Monitor):
|
||||||
self.logMsg("Item is invalid for emby deletion.", 1)
|
self.logMsg("Item is invalid for emby deletion.", 1)
|
||||||
else:
|
else:
|
||||||
# Send the delete action to the server.
|
# Send the delete action to the server.
|
||||||
offerDelete = False
|
embyconn = utils.kodiSQL('emby')
|
||||||
|
embycursor = embyconn.cursor()
|
||||||
if type == "episode" and utils.settings('deleteTV') == "true":
|
emby_db = embydb.Embydb_Functions(embycursor)
|
||||||
offerDelete = True
|
emby_dbitem = emby_db.getItem_byKodiId(kodiid, type)
|
||||||
elif type == "movie" and utils.settings('deleteMovies') == "true":
|
try:
|
||||||
offerDelete = True
|
itemid = emby_dbitem[0]
|
||||||
|
except TypeError:
|
||||||
if utils.settings('offerDelete') != "true":
|
self.logMsg("Could not find itemid in emby database.", 1)
|
||||||
# Delete could be disabled, even if the subsetting is enabled.
|
else:
|
||||||
offerDelete = False
|
if utils.settings('skipConfirmDelete') != "true":
|
||||||
|
resp = xbmcgui.Dialog().yesno(
|
||||||
if offerDelete:
|
heading="Confirm delete",
|
||||||
embyconn = utils.kodiSQL('emby')
|
line1="Delete file on Emby Server?")
|
||||||
embycursor = embyconn.cursor()
|
if not resp:
|
||||||
emby_db = embydb.Embydb_Functions(embycursor)
|
self.logMsg("User skipped deletion.", 1)
|
||||||
emby_dbitem = emby_db.getItem_byKodiId(kodiid, type)
|
embycursor.close()
|
||||||
try:
|
return
|
||||||
itemid = emby_dbitem[0]
|
url = "{server}/emby/Items/%s?format=json" % itemid
|
||||||
except TypeError:
|
self.logMsg("Deleting request: %s" % itemid)
|
||||||
self.logMsg("Could not find itemid in emby database.", 1)
|
doUtils.downloadUrl(url, type="DELETE")
|
||||||
else:
|
finally:
|
||||||
if utils.settings('skipConfirmDelete') != "true":
|
embycursor.close()
|
||||||
resp = xbmcgui.Dialog().yesno(
|
|
||||||
heading="Confirm delete",
|
|
||||||
line1="Delete file on Emby Server?")
|
|
||||||
if not resp:
|
|
||||||
self.logMsg("User skipped deletion.", 1)
|
|
||||||
embycursor.close()
|
|
||||||
return
|
|
||||||
url = "{server}/emby/Items/%s?format=json" % itemid
|
|
||||||
self.logMsg("Deleting request: %s" % itemid)
|
|
||||||
doUtils.downloadUrl(url, type="DELETE")
|
|
||||||
finally:
|
|
||||||
embycursor.close()
|
|
||||||
|
|
||||||
|
|
||||||
elif method == "System.OnWake":
|
elif method == "System.OnWake":
|
||||||
|
|
Loading…
Reference in a new issue