diff --git a/resources/lib/api.py b/resources/lib/api.py index 62130f37..555ab23b 100644 --- a/resources/lib/api.py +++ b/resources/lib/api.py @@ -2756,7 +2756,7 @@ def convert_episode(episode, destination=None): meta = raw tapu = meta.get('$tapu', '') parts = tapu.split("/") - log(0,f'tapu is {tapu}, parts is {parts}') + log(0, f'tapu is {tapu}, parts is {parts}') value = parts[4] if len(parts) > 4 else "" m = re.search(r'(\d+)', value) season_no = int(m.group(1)) if m else None @@ -2915,7 +2915,7 @@ def get_latest_episode(program_name): """Get the latest episode of a program""" latest_episode = {} video = None - latest_episode = get_latest_episode(program_name=program_name) + latest_episode = get_latest_episode_data(program_name=program_name) if latest_episode: _, _, _, title_item = convert_episode(latest_episode) video = { diff --git a/resources/lib/graphql_data.py b/resources/lib/graphql_data.py index e1e05014..6f921c84 100644 --- a/resources/lib/graphql_data.py +++ b/resources/lib/graphql_data.py @@ -195,7 +195,7 @@ text } tertiaryMeta { - ...metaFragment + ...metaData __typename } } @@ -252,12 +252,53 @@ __typename } fragment metaData on MetaDataItem { - longValue - shortValue + __typename type value - label + shortValue + longValue + icons { + ...iconFragment + __typename + } + } + fragment iconFragment on Icon { __typename + accessibilityLabel + position + type + ... on DesignSystemIcon { + value { + __typename + color + name + } + activeValue { + __typename + color + name + } + __typename + } + ... on ImageIcon { + value { + __typename + srcSet { + src + format + __typename + } + } + activeValue { + __typename + srcSet { + src + format + __typename + } + } + __typename + } } fragment componentTrackingDataFragment on IComponent { trackingData { diff --git a/tests/test_routing.py b/tests/test_routing.py index 93eea16d..95ce4c7d 100644 --- a/tests/test_routing.py +++ b/tests/test_routing.py @@ -192,18 +192,24 @@ def test_search_menu(self): @unittest.skipUnless(xbmc_addon.settings.get('username'), 'Skipping as VRT username is missing.') @unittest.skipUnless(xbmc_addon.settings.get('password'), 'Skipping as VRT password is missing.') def test_follow_route(self): - """Follow method: /follow//""" - addon.run(['plugin://plugin.video.vrt.nu/follow/1459955889901/Thuis', '0', '']) - self.assertEqual(plugin.url_for(addon.follow, program_id='1459955889901', program_title='Thuis'), - 'plugin://plugin.video.vrt.nu/follow/1459955889901/Thuis') + """Follow method: /follow//""" + program_id = '1459955889901' + entity_id = f'o%FavoriteAction|{program_id}|video-program|item|%' + entity_id = f'${b64encode(entity_id.encode("utf-8")).decode("utf-8")}' + addon.run([f'plugin://plugin.video.vrt.nu/follow/{entity_id}/Thuis', '0', '']) + self.assertEqual(plugin.url_for(addon.follow, entity_id=entity_id, entity_title='Thuis'), + f'plugin://plugin.video.vrt.nu/follow/{entity_id}/Thuis') @unittest.skipUnless(xbmc_addon.settings.get('username'), 'Skipping as VRT username is missing.') @unittest.skipUnless(xbmc_addon.settings.get('password'), 'Skipping as VRT password is missing.') def test_unfollow_route(self): - """Unfollow method: /unfollow//""" - addon.run(['plugin://plugin.video.vrt.nu/unfollow/1459955889901/Thuis', '0', '']) - self.assertEqual(plugin.url_for(addon.unfollow, program_id='1459955889901', program_title='Thuis'), - 'plugin://plugin.video.vrt.nu/unfollow/1459955889901/Thuis') + """Unfollow method: /unfollow//""" + program_id = '1459955889901' + entity_id = f'o%FavoriteAction|{program_id}|video-program|item|%' + entity_id = f'${b64encode(entity_id.encode("utf-8")).decode("utf-8")}' + addon.run([f'plugin://plugin.video.vrt.nu/unfollow/{entity_id}/Thuis', '0', '']) + self.assertEqual(plugin.url_for(addon.unfollow, entity_id=entity_id, entity_title='Thuis'), + f'plugin://plugin.video.vrt.nu/unfollow/{entity_id}/Thuis') def test_clear_cookies_route(self): """Delete tokens method: /tokens/delete"""