Skip to content

Commit

Permalink
'fallback' image is not always available
Browse files Browse the repository at this point in the history
  • Loading branch information
emilsvennesson committed Jul 23, 2018
1 parent 23a4ec7 commit 2baf467
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions resources/lib/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ def channels():

for channel in channels_dict['channels']:
plugin_url = plugin.url_for(list_products, url=channel['_links']['self']['href'])
if 'fallback' in channel['content']['images']:
channel_image = channel['content']['images']['fallback']['template'].split('{')[0]
else:
channel_image = channel['content']['images']['logo']['template'].split('{')[0]
art = {
'thumb': channel['content']['images']['fallback']['template'].split('{')[0],
'fanart': channel['content']['images']['fallback']['template'].split('{')[0]
'thumb': channel_image,
'fanart': channel_image
}

for program in channel['_embedded']['viaplay:products']: # get current live program
Expand Down

0 comments on commit 2baf467

Please sign in to comment.