mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06: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():
|
||||
|
||||
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")
|
||||
|
||||
|
|
|
@ -119,6 +119,8 @@ class Service():
|
|||
countSync = librarySync.updatePlayCounts()
|
||||
xbmc.log("Doing_Db_Sync: updatePlayCounts (Finished) " + str(countSync))
|
||||
|
||||
# Force refresh newly set thumbnails
|
||||
xbmc.executebuiltin("UpdateLibrary(video)")
|
||||
if(libSync and countSync):
|
||||
startupComplete = True
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue