mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
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:
parent
0e5ecd38d3
commit
060a6f1323
2 changed files with 20 additions and 1 deletions
|
@ -154,9 +154,20 @@ def removeDirectory(path):
|
||||||
|
|
||||||
def reset():
|
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?")
|
return_value = xbmcgui.Dialog().yesno("Warning", "Are you sure you want to reset your local database?")
|
||||||
|
|
||||||
if return_value == 0:
|
if return_value == 0:
|
||||||
return
|
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
|
# first stop any db sync
|
||||||
WINDOW = xbmcgui.Window( 10000 )
|
WINDOW = xbmcgui.Window( 10000 )
|
||||||
|
@ -188,7 +199,13 @@ def reset():
|
||||||
# reset the install run flag
|
# reset the install run flag
|
||||||
WINDOW.setProperty("SyncInstallRunDone", "false")
|
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 = 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")
|
xbmc.executebuiltin("RestartApp")
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,8 @@ class Service():
|
||||||
countSync = librarySync.updatePlayCounts()
|
countSync = librarySync.updatePlayCounts()
|
||||||
xbmc.log("Doing_Db_Sync: updatePlayCounts (Finished) " + str(countSync))
|
xbmc.log("Doing_Db_Sync: updatePlayCounts (Finished) " + str(countSync))
|
||||||
|
|
||||||
|
# Force refresh newly set thumbnails
|
||||||
|
xbmc.executebuiltin("UpdateLibrary(video)")
|
||||||
if(libSync and countSync):
|
if(libSync and countSync):
|
||||||
startupComplete = True
|
startupComplete = True
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue