From 1d8b9824ad9bfa3e7cfd29cb875ecad3d9ef5163 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 18 Sep 2022 09:36:00 -0400 Subject: [PATCH] Force unique client IDs when using quick connect --- resources/lib/utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 592d0f7..d214369 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -144,14 +144,15 @@ def get_device_id(): window = HomeWindow() username = window.get_property('user_name') - if not username: - settings = xbmcaddon.Addon() - username = settings.getSetting('username') client_id = window.get_property("client_id") hashed_name = hashlib.md5(username.encode()).hexdigest() - if client_id: + if client_id and username: return '{}-{}'.format(client_id, hashed_name) + elif client_id and not username: + # Quick Connect, needs to be unique so sessions don't overwrite + rand_id = uuid4().hex + return '{}-{}'.format(client_id, rand_id) jellyfin_guid_path = py2_decode(translate_path("special://temp/jellycon_guid")) log.debug("jellyfin_guid_path: {0}".format(jellyfin_guid_path))