Add reset password dialog to addon menu

This commit is contained in:
Matt 2020-05-19 21:47:19 -04:00
parent 3f63b3d0e0
commit 22b5d413fd
5 changed files with 16 additions and 2 deletions

View file

@ -253,8 +253,9 @@ class Connect(object):
client.set_credentials(get_credentials()) client.set_credentials(get_credentials())
manager = client.auth manager = client.auth
username = settings('username')
try: try:
self.login_manual(manager=manager) self.login_manual(user=username, manager=manager)
except RuntimeError: except RuntimeError:
return return

View file

@ -112,6 +112,8 @@ class Events(object):
xbmc.executebuiltin('Addon.OpenSettings(plugin.video.jellyfin)') xbmc.executebuiltin('Addon.OpenSettings(plugin.video.jellyfin)')
elif mode == 'adduser': elif mode == 'adduser':
add_user() add_user()
elif mode == 'updatepassword':
event('UpdatePassword')
elif mode == 'thememedia': elif mode == 'thememedia':
get_themes() get_themes()
elif mode == 'managelibs': elif mode == 'managelibs':
@ -177,6 +179,7 @@ def listing():
directory(translate(33134), "plugin://plugin.video.jellyfin/?mode=addserver", False) directory(translate(33134), "plugin://plugin.video.jellyfin/?mode=addserver", False)
directory(translate(33054), "plugin://plugin.video.jellyfin/?mode=adduser", False) directory(translate(33054), "plugin://plugin.video.jellyfin/?mode=adduser", False)
directory(translate(5), "plugin://plugin.video.jellyfin/?mode=settings", False) directory(translate(5), "plugin://plugin.video.jellyfin/?mode=settings", False)
directory(translate(33161), "plugin://plugin.video.jellyfin/?mode=updatepassword", False)
directory(translate(33058), "plugin://plugin.video.jellyfin/?mode=reset", False) directory(translate(33058), "plugin://plugin.video.jellyfin/?mode=reset", False)
directory(translate(33180), "plugin://plugin.video.jellyfin/?mode=restartservice", False) directory(translate(33180), "plugin://plugin.video.jellyfin/?mode=restartservice", False)

View file

@ -156,7 +156,7 @@ class Service(xbmc.Monitor):
'LibraryChanged', 'ServerOnline', 'SyncLibrary', 'RepairLibrary', 'RemoveLibrary', 'LibraryChanged', 'ServerOnline', 'SyncLibrary', 'RepairLibrary', 'RemoveLibrary',
'SyncLibrarySelection', 'RepairLibrarySelection', 'AddServer', 'SyncLibrarySelection', 'RepairLibrarySelection', 'AddServer',
'Unauthorized', 'UserConfigurationUpdated', 'ServerRestarting', 'Unauthorized', 'UserConfigurationUpdated', 'ServerRestarting',
'RemoveServer', 'AddLibrarySelection', 'RemoveLibrarySelection'): 'RemoveServer', 'UpdatePassword', 'AddLibrarySelection', 'RemoveLibrarySelection'):
return return
data = json.loads(data)[0] data = json.loads(data)[0]
@ -243,6 +243,8 @@ class Service(xbmc.Monitor):
self.connect.remove_server(data['Id']) self.connect.remove_server(data['Id'])
xbmc.executebuiltin("Container.Refresh") xbmc.executebuiltin("Container.Refresh")
elif method == 'UpdatePassword':
self.connect.setup_login_manual()
elif method == 'UserDataChanged' and self.library_thread: elif method == 'UserDataChanged' and self.library_thread:
if data.get('ServerId') or not window('jellyfin_startup.bool'): if data.get('ServerId') or not window('jellyfin_startup.bool'):
return return

View file

@ -801,6 +801,10 @@ msgctxt "#33160"
msgid "To avoid errors, please update Jellyfin for Kodi to version: " msgid "To avoid errors, please update Jellyfin for Kodi to version: "
msgstr "To avoid errors, please update Jellyfin for Kodi to version: " msgstr "To avoid errors, please update Jellyfin for Kodi to version: "
msgctxt "#33161"
msgid "Update password"
msgstr "Update password"
msgctxt "#33162" msgctxt "#33162"
msgid "Reset the music library?" msgid "Reset the music library?"
msgstr "Reset the music library?" msgstr "Reset the music library?"

View file

@ -801,6 +801,10 @@ msgctxt "#33160"
msgid "To avoid errors, please update Jellyfin for Kodi to version: " msgid "To avoid errors, please update Jellyfin for Kodi to version: "
msgstr "To avoid errors, please update Jellyfin for Kodi to version: " msgstr "To avoid errors, please update Jellyfin for Kodi to version: "
msgctxt "#33161"
msgid "Update password"
msgstr "Update password"
msgctxt "#33162" msgctxt "#33162"
msgid "Reset the music library?" msgid "Reset the music library?"
msgstr "Reset the music library?" msgstr "Reset the music library?"