Skip to content

Commit

Permalink
Fix api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Opvolger committed Mar 21, 2020
1 parent 5e855c7 commit 5996621
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.uzg" name="Uitzendinggemist (NPO)" provider-name="Bas Magré (Opvolger)" version="3.4.2">
<addon id="plugin.video.uzg" name="Uitzendinggemist (NPO)" provider-name="Bas Magré (Opvolger)" version="3.5.0">
<requires>
<import addon="xbmc.python" version="2.25.0" />
<import addon="script.module.inputstreamhelper" version="0.3.5" />
Expand Down
5 changes: 4 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Version 3.4.2
Version 3.5.0
* api-changes

Version 3.4.2
* api-key was aangepast.

Version 3.4.1
Expand Down
19 changes: 13 additions & 6 deletions resources/lib/npoapihelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,23 @@ def __get_video_request_data(profile):
@staticmethod
def get_image(item):
thumbnail = ''
if item['images'] and item['images']['original']:
if (item['images']['original']['formats'].get('original') is not None):
thumbnail = item['images']['original']['formats']['original']['source']
if (item['images']['original']['formats'].get('tv') is not None):
thumbnail = item['images']['original']['formats']['tv']['source']
if item['images'] and item['images'].get('chromecast.post-play') and item['images']['chromecast.post-play']:
if (item['images']['chromecast.post-play']['formats'].get('tv-expanded') is not None):
thumbnail = item['images']['chromecast.post-play']['formats']['tv-expanded']['source']
if thumbnail == '' and (item['images']['chromecast.post-play']['formats'].get('tv') is not None):
thumbnail = item['images']['chromecast.post-play']['formats']['tv']['source']
if thumbnail == '' and item['images'] and item['images'].get('grid.tile') and item['images']['grid.tile']:
if (item['images']['grid.tile']['formats'].get('tv') is not None):
thumbnail = item['images']['grid.tile']['formats']['tv']['source']
if (item['images']['grid.tile']['formats'].get('tv-expanded') is not None):
thumbnail = item['images']['grid.tile']['formats']['tv-expanded']['source']
return thumbnail

@staticmethod
def get_studio(item):
return ', '.join(item['broadcasters'])
if item['broadcasters']:
return ', '.join(item['broadcasters'])
return ''

@staticmethod
def get_genres(item):
Expand Down

0 comments on commit 5996621

Please sign in to comment.