From d6a79bf01b422b89a8cad5cf9e424d6ef21a9634 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 7 Mar 2016 16:23:26 -0600 Subject: [PATCH 1/5] Version bump 2.2.9 --- addon.xml | 8 ++++---- changelog.txt | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/addon.xml b/addon.xml index f87c512d..12d11eb6 100644 --- a/addon.xml +++ b/addon.xml @@ -1,14 +1,14 @@ - - - + + + diff --git a/changelog.txt b/changelog.txt index baa14c63..1d873a7d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +version 2.2.9 +- Fix extrafanart + version 2.2.8 - Fix to photos not displaying directories without picutres. - Fix to grouped views causing crash From 8bde429da41ac2cc70b8f2f11c44d2802f1c1088 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Tue, 8 Mar 2016 18:51:23 -0600 Subject: [PATCH 2/5] Slight adjust for manual sync Can't return value in __init__, instead calling a function to know if manual sync succeeded or not. --- default.py | 2 +- resources/lib/librarysync.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/default.py b/default.py index 40c4edf4..724e7303 100644 --- a/default.py +++ b/default.py @@ -114,7 +114,7 @@ class Main: import librarysync lib = librarysync.LibrarySync() if mode == "manualsync": - librarysync.ManualSync(dialog=True) + librarysync.ManualSync().sync(dialog=True) else: lib.fullSync(repair=True) else: diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 4b885ca9..dacebbde 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -93,7 +93,7 @@ class LibrarySync(threading.Thread): if not completed: # Fast sync failed or server plugin is not found - completed = ManualSync() + completed = ManualSync().sync() else: # Install sync is not completed completed = self.fullSync() @@ -1069,11 +1069,14 @@ class LibrarySync(threading.Thread): class ManualSync(LibrarySync): - def __init__(self, dialog=False): + def __init__(self): LibrarySync.__init__(self) - self.fullSync(manualrun=True, forceddialog=dialog) + def sync(self, dialog=False): + + return self.fullSync(manualrun=True, forceddialog=dialog) + def movies(self, embycursor, kodicursor, pdialog): From a5d74c8a17a374b571376fe56c1ebf2bd1717a55 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Wed, 9 Mar 2016 17:05:35 -0600 Subject: [PATCH 3/5] Add delete keymap entrypoint RunPlugin(plugin://plugin.video.emby?mode=delete) --- default.py | 3 ++- resources/lib/entrypoint.py | 50 +++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/default.py b/default.py index 724e7303..94117d69 100644 --- a/default.py +++ b/default.py @@ -62,7 +62,8 @@ class Main: 'inprogressepisodes': entrypoint.getInProgressEpisodes, 'recentepisodes': entrypoint.getRecentEpisodes, 'refreshplaylist': entrypoint.refreshPlaylist, - 'deviceid': entrypoint.resetDeviceId + 'deviceid': entrypoint.resetDeviceId, + 'delete': entrypoint.deleteItem } if "/extrafanart" in sys.argv[0]: diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index af69a251..12ed547a 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -118,6 +118,56 @@ def resetDeviceId(): line1=language(33033)) xbmc.executebuiltin('RestartApp') +##### Delete Item, like the context menu action +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: + embyconn = utils.kodiSQL('emby') + embycursor = embyconn.cursor() + emby_db = embydb.Embydb_Functions(embycursor) + item = emby_db.getItem_byKodiId(dbid, itemtype) + embycursor.close() + + try: + embyid = item[0] + except TypeError: + utils.logMsg("EMBY delete", "Unknown embyId, unable to proceed.", 1) + return + + if utils.settings('skipContextMenu') != "true": + resp = xbmcgui.Dialog().yesno( + heading="Confirm delete", + line1=("Delete file from Emby Server? This will " + "also delete the file(s) from disk!")) + if not resp: + utils.logMsg("EMBY delete", "User skipped deletion for: %s." % embyid, 1) + return + + doUtils = downloadutils.DownloadUtils() + url = "{server}/emby/Items/%s?format=json" % embyid + utils.logMsg("EMBY delete", "Deleting request: %s" % embyid, 0) + doUtils.downloadUrl(url, type="DELETE") + ##### ADD ADDITIONAL USERS ##### def addUser(): From 9ab82905cb9b4bd9ee9fc9edb1961405e2db2f98 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Wed, 9 Mar 2016 17:06:42 -0600 Subject: [PATCH 4/5] Fix open cursor --- contextmenu.py | 1 + 1 file changed, 1 insertion(+) diff --git a/contextmenu.py b/contextmenu.py index 66256dca..be7a3df7 100644 --- a/contextmenu.py +++ b/contextmenu.py @@ -51,6 +51,7 @@ if __name__ == '__main__': embycursor = embyconn.cursor() emby_db = embydb.Embydb_Functions(embycursor) item = emby_db.getItem_byKodiId(itemid, itemtype) + embycursor.close() if item: embyid = item[0] logMsg("Contextmenu opened for embyid: %s - itemtype: %s" %(embyid,itemtype)) From db4cb448b0e4fd82662f8b82a800d8da8ea33688 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Wed, 9 Mar 2016 20:15:45 -0600 Subject: [PATCH 5/5] 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)