diff --git a/addon.xml b/addon.xml index 0e7d14e..fe456cf 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@  - + @@ -24,7 +24,10 @@ all GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 and MIT LICENSE. https://github.com/Mariusz89B/plugin.video.viaplay - v2.4.4 (2023-03-12) + v2.4.5 (2023-04-17) +- Bug fixes. + +v2.4.4 (2023-03-12) - Fixed bug when returning from search. - Added option to enable/disable synchronization. diff --git a/changelog.txt b/changelog.txt index 08cb880..100f549 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +v2.4.5 (2023-04-17) +- Bug fixes. + v2.4.4 (2023-03-12) - Fixed bug when returning from search. - Added option to enable/disable synchronization. diff --git a/resources/lib/addon.py b/resources/lib/addon.py index d8eab17..ebc47d8 100644 --- a/resources/lib/addon.py +++ b/resources/lib/addon.py @@ -367,17 +367,17 @@ def root(): } profiles_dict = helper.vp.get_profiles() + if profiles_dict: + for profile in profiles_dict: + if helper.vp.get_setting('profileid'): + id = helper.vp.get_setting('profileid') + else: + id = helper.vp.get_user_id()['id'] - for profile in profiles_dict: - if helper.vp.get_setting('profileid'): - id = helper.vp.get_setting('profileid') - else: - id = helper.vp.get_user_id()['id'] - - if id == profile['data'].get('id'): - name = '{0} {1}'.format(helper.language(30090), profile['data'].get('name')) - avatar = {'thumb': profile['embedded']['avatar']['data'].get('url')} - helper.add_item(name, plugin.url_for(profiles), art=avatar) + if id == profile['data'].get('id'): + name = '{0} {1}'.format(helper.language(30090), profile['data'].get('name')) + avatar = {'thumb': profile['embedded']['avatar']['data'].get('url')} + helper.add_item(name, plugin.url_for(profiles), art=avatar) sorted_json = sorted(pages, key=lambda x: x['name'] == 'viaplay:logout') diff --git a/resources/lib/kodihelper.py b/resources/lib/kodihelper.py index f79dbe6..da0fc06 100644 --- a/resources/lib/kodihelper.py +++ b/resources/lib/kodihelper.py @@ -89,8 +89,10 @@ def get_country_code(self): def get_tld(self): country_code = self.get_country_code() - if country_code == "nl": - return "com" + if country_code == 'nl': + return 'com' + elif country_code == 'gb': + return 'com' return country_code def dialog(self, dialog_type, heading, message=None, options=None, nolabel=None, yeslabel=None, useDetails=False): diff --git a/resources/lib/viaplay.py b/resources/lib/viaplay.py index b865204..ef0c70d 100644 --- a/resources/lib/viaplay.py +++ b/resources/lib/viaplay.py @@ -222,8 +222,9 @@ def get_profiles(self): profiles = None - if data['embedded'].get('profiles'): - profiles = data['embedded']['profiles'] + if data: + if data['embedded'].get('profiles'): + profiles = data['embedded']['profiles'] return profiles