alter reset so that addon data dir is always removed when video db

delete fails
This commit is contained in:
im85288 2015-04-03 18:42:15 +01:00
parent 7cfbafe16b
commit 30de132920
2 changed files with 8 additions and 8 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.emby" <addon id="plugin.video.emby"
name="Emby" name="Emby"
version="0.0.9" version="0.0.10"
provider-name="Emby.media"> provider-name="Emby.media">
<requires> <requires>
<import addon="xbmc.python" version="2.1.0"/> <import addon="xbmc.python" version="2.1.0"/>

View file

@ -171,6 +171,12 @@ def reset():
return return
xbmc.sleep(1000) 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 # delete db
deletecount = 0 deletecount = 0
deleted = False deleted = False
@ -189,15 +195,9 @@ def reset():
# extra check on the database to see it has been removed # extra check on the database to see it has been removed
if xbmcvfs.exists(getKodiDBPath()): if xbmcvfs.exists(getKodiDBPath()):
dialog = xbmcgui.Dialog() 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 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 # remove old entries from sources.xml
dialog = xbmcgui.Dialog() dialog = xbmcgui.Dialog()