From 30de132920642fe63eba8920c1efda1f06b01864 Mon Sep 17 00:00:00 2001 From: im85288 Date: Fri, 3 Apr 2015 18:42:15 +0100 Subject: [PATCH] alter reset so that addon data dir is always removed when video db delete fails --- addon.xml | 2 +- resources/lib/Utils.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addon.xml b/addon.xml index e024e48b..4432e70e 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/Utils.py b/resources/lib/Utils.py index d51a34ce..669d5a5f 100644 --- a/resources/lib/Utils.py +++ b/resources/lib/Utils.py @@ -171,6 +171,12 @@ def reset(): return xbmc.sleep(1000) + # remove from addon data directory + addon = xbmcaddon.Addon(id='plugin.video.emby') + addondir = xbmc.translatePath(addon.getAddonInfo('profile')) + dataPath = os.path.join(addondir + os.sep) + removeDirectory(dataPath) + # delete db deletecount = 0 deleted = False @@ -189,15 +195,9 @@ def reset(): # extra check on the database to see it has been removed if xbmcvfs.exists(getKodiDBPath()): dialog = xbmcgui.Dialog() - dialog.ok('Error', 'The video database could not be deleted, this will need to be done manually. First remove: '+getKodiDBPath() + ' Then delete the plugin from your addon_data directory and restart Kodi') + dialog.ok('Error', 'The video database could not be deleted, this will need to be done manually. Remove: '+getKodiDBPath() + ' then restart Kodi') return - # remove from addon data directory - addon = xbmcaddon.Addon(id='plugin.video.emby') - addondir = xbmc.translatePath(addon.getAddonInfo('profile')) - dataPath = os.path.join(addondir + os.sep) - removeDirectory(dataPath) - # remove old entries from sources.xml dialog = xbmcgui.Dialog()