From 1493e24128161fa249650a11b2948459e90f7e56 Mon Sep 17 00:00:00 2001 From: asciidisco Date: Thu, 17 Aug 2017 20:37:53 +0200 Subject: [PATCH] fix(list): Fixes failure with plugin stopping when malformed list entries occur --- addon.py | 16 ++++++++-------- addon.xml | 9 +++++---- resources/language/English/strings.po | 2 +- resources/language/German/strings.po | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/addon.py b/addon.py index cb6a237..f695c92 100644 --- a/addon.py +++ b/addon.py @@ -181,12 +181,13 @@ def get_epg(_session, _for): for slot in slots: events = slot.get('events') for event in events: - page_tree.get(element_date).append({ - 'hash': generateHash(event.get('target_url')), - 'url': base_url + event.get('target_url'), - 'title': event.get('metadata').get('details').get('home').get('name_full') + ' - ' + event.get('metadata').get('details').get('away').get('name_full') + ' (' + datetime.fromtimestamp(float(event.get('metadata').get('scheduled_start').get('utc_timestamp'))).strftime('%H:%M') + ' Uhr)', - 'shorts': (event.get('metadata').get('details').get('home').get('name_mini'), event.get('metadata').get('details').get('away').get('name_mini')), - }) + if event.get('metadata', {}).get('details', {}).get('home') is not None: + page_tree.get(element_date).append({ + 'hash': generateHash(event.get('target_url')), + 'url': base_url + event.get('target_url'), + 'title': event.get('metadata').get('details').get('home').get('name_full') + ' - ' + event.get('metadata').get('details').get('away').get('name_full') + ' (' + datetime.fromtimestamp(float(event.get('metadata').get('scheduled_start').get('utc_timestamp'))).strftime('%H:%M') + ' Uhr)', + 'shorts': (event.get('metadata').get('details').get('home').get('name_mini'), event.get('metadata').get('details').get('away').get('name_mini')), + }) else: element_date = date.fromtimestamp(float(element.get('metadata').get('scheduled_start').get('utc_timestamp'))).strftime('%d.%m.%Y') if page_tree.get(element_date) is None: @@ -416,7 +417,6 @@ def play(_session, name, game_hash, game_date, _for, use_inputstream): streams = get_stream_urls(_session, item.get('url')) for stream in streams: if stream == name: - log(streams.get(stream)) play_item = xbmcgui.ListItem(path=get_m3u_url(_session, streams.get(stream))) if use_inputstream is True: play_item.setProperty('inputstream.adaptive.manifest_type', 'hls') @@ -481,7 +481,7 @@ def router(paramstring, _session, user, password, use_inputstream): log('Inputstream Version: ' + str(inputstream_version)) # determine if we can use inputstream for HLS use_inputstream = False - if kodi_version >= 18 and inputstream_version >= 207: + if kodi_version >= 17 and inputstream_version >= 207: use_inputstream = True # setup in memory cache for epg data setup_memcache() diff --git a/addon.xml b/addon.xml index b9873f9..818553b 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -28,8 +28,9 @@ https://www.telekomsport.de/ [public] at [asciidisco] dot [com] https://github.com/asciidisco/plugin.video.telekom-sport - -- Adds abbility to play the streams via inputstream.adaptive if version is 2.0.7 or higher & Kodi version is 18 or higher - + v1.0.5 (2017-08-17) + - Fixes issues with non standard game maps + - Enables inputstream usage for Kodi 17 + \ No newline at end of file diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index 6459b97..7860879 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -1,7 +1,7 @@ # Kodi Media Center language file # Addon Name: Telekom Sport # Addon id: plugin.video.telekom-sport -# Addon version: 1.0.4 +# Addon version: 1.0.5 # Addon Provider: asciidisco msgid "" msgstr "" diff --git a/resources/language/German/strings.po b/resources/language/German/strings.po index 9313a78..de66fe7 100644 --- a/resources/language/German/strings.po +++ b/resources/language/German/strings.po @@ -1,7 +1,7 @@ # Kodi Media Center language file # Addon Name: Telekom Sport # Addon id: plugin.video.telekom-sport -# Addon version: 1.0.4 +# Addon version: 1.0.5 # Addon Provider: asciidisco msgid "" msgstr ""