Skip to content

Commit

Permalink
Fix getting latest episode
Browse files Browse the repository at this point in the history
  • Loading branch information
mediaminister committed Oct 4, 2024
1 parent 246920e commit b708af1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def get_latest_episode_data(program_name):
variables = {
'pageId': '/vrtnu/a-z/{}.model.json'.format(program_name),
}
return api_req(graphql_query, operation_name, variables)
return api_req(graphql_query, operation_name, variables, client='MobileAndroid')


def get_seasons_data(program_name):
Expand Down Expand Up @@ -1050,7 +1050,7 @@ def get_latest_episode(program_name):
page = api_data.get('data').get('page')
if page:
most_relevant_ep = page.get('components')[0].get('mostRelevantEpisodeTile')
if most_relevant_ep.get('title') == 'Meest recente aflevering':
if most_relevant_ep and most_relevant_ep.get('title') == 'Meest recente aflevering':
latest_episode = most_relevant_ep
else:
items = page.get('components')[1].get('items')[0].get('components')[0]
Expand Down

0 comments on commit b708af1

Please sign in to comment.