From 22b5d413fd59237d63ec10220eb5a4f629c505ce Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 19 May 2020 21:47:19 -0400 Subject: [PATCH] Add reset password dialog to addon menu --- jellyfin_kodi/connect.py | 3 ++- jellyfin_kodi/entrypoint/default.py | 3 +++ jellyfin_kodi/entrypoint/service.py | 4 +++- resources/language/resource.language.en_gb/strings.po | 4 ++++ resources/language/resource.language.en_us/strings.po | 4 ++++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/jellyfin_kodi/connect.py b/jellyfin_kodi/connect.py index cc535370..2e95bc2b 100644 --- a/jellyfin_kodi/connect.py +++ b/jellyfin_kodi/connect.py @@ -253,8 +253,9 @@ class Connect(object): client.set_credentials(get_credentials()) manager = client.auth + username = settings('username') try: - self.login_manual(manager=manager) + self.login_manual(user=username, manager=manager) except RuntimeError: return diff --git a/jellyfin_kodi/entrypoint/default.py b/jellyfin_kodi/entrypoint/default.py index fac8581f..b21a71e4 100644 --- a/jellyfin_kodi/entrypoint/default.py +++ b/jellyfin_kodi/entrypoint/default.py @@ -112,6 +112,8 @@ class Events(object): xbmc.executebuiltin('Addon.OpenSettings(plugin.video.jellyfin)') elif mode == 'adduser': add_user() + elif mode == 'updatepassword': + event('UpdatePassword') elif mode == 'thememedia': get_themes() elif mode == 'managelibs': @@ -177,6 +179,7 @@ def listing(): directory(translate(33134), "plugin://plugin.video.jellyfin/?mode=addserver", False) directory(translate(33054), "plugin://plugin.video.jellyfin/?mode=adduser", 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(33180), "plugin://plugin.video.jellyfin/?mode=restartservice", False) diff --git a/jellyfin_kodi/entrypoint/service.py b/jellyfin_kodi/entrypoint/service.py index dace0288..8fc8f36e 100644 --- a/jellyfin_kodi/entrypoint/service.py +++ b/jellyfin_kodi/entrypoint/service.py @@ -156,7 +156,7 @@ class Service(xbmc.Monitor): 'LibraryChanged', 'ServerOnline', 'SyncLibrary', 'RepairLibrary', 'RemoveLibrary', 'SyncLibrarySelection', 'RepairLibrarySelection', 'AddServer', 'Unauthorized', 'UserConfigurationUpdated', 'ServerRestarting', - 'RemoveServer', 'AddLibrarySelection', 'RemoveLibrarySelection'): + 'RemoveServer', 'UpdatePassword', 'AddLibrarySelection', 'RemoveLibrarySelection'): return data = json.loads(data)[0] @@ -243,6 +243,8 @@ class Service(xbmc.Monitor): self.connect.remove_server(data['Id']) xbmc.executebuiltin("Container.Refresh") + elif method == 'UpdatePassword': + self.connect.setup_login_manual() elif method == 'UserDataChanged' and self.library_thread: if data.get('ServerId') or not window('jellyfin_startup.bool'): return diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 23b7e37c..c4690526 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -801,6 +801,10 @@ msgctxt "#33160" msgid "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" msgid "Reset the music library?" msgstr "Reset the music library?" diff --git a/resources/language/resource.language.en_us/strings.po b/resources/language/resource.language.en_us/strings.po index 95daafd6..bf410eca 100644 --- a/resources/language/resource.language.en_us/strings.po +++ b/resources/language/resource.language.en_us/strings.po @@ -801,6 +801,10 @@ msgctxt "#33160" msgid "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" msgid "Reset the music library?" msgstr "Reset the music library?"