Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand Down
49 changes: 45 additions & 4 deletions resources/lib/graphql_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
text
}
tertiaryMeta {
...metaFragment
...metaData
__typename
}
}
Expand Down Expand Up @@ -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 {
Expand Down
22 changes: 14 additions & 8 deletions tests/test_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/<program_id>/<program_title>"""
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/<entity_id>/<entity_title>"""
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/<program_id>/<program_title>"""
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/<entity_id>/<program_title>"""
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"""
Expand Down
Loading