Add option to delete user info

Added for testing update library to force refresh newly set thumbnails
after first sync (only).
This commit is contained in:
angelblue05 2015-04-12 08:49:36 -05:00
parent 0e5ecd38d3
commit 060a6f1323
2 changed files with 20 additions and 1 deletions

View file

@ -154,9 +154,20 @@ def removeDirectory(path):
def reset():
WINDOW = xbmcgui.Window( 10000 )
username = WINDOW.getProperty('currUser')
user_delete = False
return_value = xbmcgui.Dialog().yesno("Warning", "Are you sure you want to reset your local database?")
if return_value == 0:
return
# Ask if user information should be deleted too.
return_user = xbmcgui.Dialog().yesno("Warning", "Do you wish to erase your saved Emby user information for %s?" % username)
if return_user == 1:
user_delete = True
# first stop any db sync
WINDOW = xbmcgui.Window( 10000 )
@ -188,7 +199,13 @@ def reset():
# reset the install run flag
WINDOW.setProperty("SyncInstallRunDone", "false")
if (user_delete == True):
addondir = xbmc.translatePath(addonSettings.getAddonInfo('profile'))
dataPath = os.path.join(addondir + "settings.xml")
xbmcvfs.delete(dataPath)
xbmc.log("Deleted saved user information for: %s" % username)
dialog = xbmcgui.Dialog()
dialog.ok('Emby Reset', 'Database reset has completed, kodi will now restart to apply the changes.')
dialog.ok('Emby Reset', 'Database reset has completed, Kodi will now restart to apply the changes.')
xbmc.executebuiltin("RestartApp")