From db4cb448b0e4fd82662f8b82a800d8da8ea33688 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Wed, 9 Mar 2016 20:15:45 -0600 Subject: [PATCH] Adjust delete logic for entrypoint --- resources/lib/entrypoint.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index 12ed547a..b565392a 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -118,30 +118,30 @@ def resetDeviceId(): line1=language(33033)) xbmc.executebuiltin('RestartApp') -##### Delete Item, like the context menu action +##### Delete Item def deleteItem(): # Serves as a keymap action - dbid = xbmc.getInfoLabel('ListItem.DBID') - itemtype = xbmc.getInfoLabel('ListItem.DBTYPE') - - if not itemtype: - - if xbmc.getCondVisibility('Container.Content(albums)'): - itemtype = "album" - elif xbmc.getCondVisibility('Container.Content(artists)'): - itemtype = "artist" - elif xbmc.getCondVisibility('Container.Content(songs)'): - itemtype = "song" - elif xbmc.getCondVisibility('Container.Content(pictures)'): - itemtype = "picture" - else: - utils.logMsg("EMBY delete", "Unknown type, unable to proceed.", 1) - return - if xbmc.getInfoLabel('ListItem.Property(embyid)'): # If we already have the embyid embyid = xbmc.getInfoLabel('ListItem.Property(embyid)') else: + dbid = xbmc.getInfoLabel('ListItem.DBID') + itemtype = xbmc.getInfoLabel('ListItem.DBTYPE') + + if not itemtype: + + if xbmc.getCondVisibility('Container.Content(albums)'): + itemtype = "album" + elif xbmc.getCondVisibility('Container.Content(artists)'): + itemtype = "artist" + elif xbmc.getCondVisibility('Container.Content(songs)'): + itemtype = "song" + elif xbmc.getCondVisibility('Container.Content(pictures)'): + itemtype = "picture" + else: + utils.logMsg("EMBY delete", "Unknown type, unable to proceed.", 1) + return + embyconn = utils.kodiSQL('emby') embycursor = embyconn.cursor() emby_db = embydb.Embydb_Functions(embycursor)