From 91e38eb6ca45e97132fbf00993981436059d9aa7 Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:14:07 +1100 Subject: [PATCH] Ensure current_user value is loaded as int --- .../youtube_plugin/kodion/json_store/access_manager.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/lib/youtube_plugin/kodion/json_store/access_manager.py b/resources/lib/youtube_plugin/kodion/json_store/access_manager.py index e54b0dc62..f4d152802 100644 --- a/resources/lib/youtube_plugin/kodion/json_store/access_manager.py +++ b/resources/lib/youtube_plugin/kodion/json_store/access_manager.py @@ -111,6 +111,11 @@ def _process_data(data): int(key): value for key, value in users.items() } + current_user = data['access_manager']['current_user'] + try: + data['access_manager']['current_user'] = int(current_user) + except (TypeError, ValueError): + pass return data def get_data(self, process=_process_data.__func__): @@ -216,6 +221,11 @@ def set_user(self, user, switch_to=False): :param switch_to: boolean, change current user :return: """ + try: + user = int(user) + except (TypeError, ValueError): + pass + self._user = user if switch_to: data = {