From 6949d25f89728f17e4be8bff5923a809d7945cbb Mon Sep 17 00:00:00 2001 From: enen92 <92enen@gmail.com> Date: Mon, 13 Apr 2020 12:25:56 +0100 Subject: [PATCH] Version 3.0.1 (backports) --- addon.xml | 9 +++------ changelog.txt | 3 +++ resources/lib/api.py | 19 ++++++++++++++++++- resources/lib/plugin.py | 2 +- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/addon.xml b/addon.xml index 4d6c120..9cc1033 100644 --- a/addon.xml +++ b/addon.xml @@ -1,4 +1,4 @@ - + @@ -12,11 +12,8 @@ https://github.com/XBMC-Addons/plugin.audio.radio_de https://forum.kodi.tv/showthread.php?tid=119362 GPL-2.0-only - 3.0.0 (12/4/2020) - [fix] playlist based stations (backport) - [fix] ratings (backport) - [new] removed python3 compatibility - [new] automated submissions to repository + 3.0.1 (13/4/2020) + - [new] Use internal playlist resolver also in custom stations (backport) Access >7000 radio broadcasts accedeix a mes de 7000 emissores de radio diff --git a/changelog.txt b/changelog.txt index d78a514..5dad344 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +3.0.1 (13/4/2020) + - [new] Use internal playlist resolver also in custom stations + 3.0.0 (12/4/2020) - [fix] playlist based stations (backport) - [fix] ratings (backport) diff --git a/resources/lib/api.py b/resources/lib/api.py index 3aba5d1..f5fd3f1 100644 --- a/resources/lib/api.py +++ b/resources/lib/api.py @@ -138,6 +138,17 @@ def get_station_by_station_id(self, station_id, resolve_playlists=True, force_ht stations = (station, ) return self.__format_stations_v2(stations)[0] + def internal_resolver(self, station, ): + if station.get('is_custom', False): + stream_url = station['stream_url'] + else: + stream_url = station['streamUrl'] + + if self.__check_paylist(stream_url): + return self.__resolve_playlist(station) + else: + return station + def get_top_stations(self, sizeperpage, pageindex): self.log(('get_top_stations started with ' 'sizeperpage=%s, pageindex=%s') % ( @@ -258,7 +269,13 @@ def __resolve_playlist(self, station): self.log('__resolve_playlist started with station=%s' % station['id']) servers = [] - stream_url = station['streamUrl'] + + # Check if it is a custom station + if station.get('is_custom', False): + stream_url = station['stream_url'] + else: + stream_url = station['streamUrl'] + if stream_url.lower().endswith('m3u'): response = self.__urlopen(stream_url) self.log('__resolve_playlist found .m3u file') diff --git a/resources/lib/plugin.py b/resources/lib/plugin.py index 81e7d0f..f7d7023 100644 --- a/resources/lib/plugin.py +++ b/resources/lib/plugin.py @@ -476,7 +476,7 @@ def sub_menu_entry(option, category, value, page=1): def get_stream_url(station_id): if my_stations.get(station_id, {}).get('is_custom', False): station = my_stations[station_id] - stream_url = station['stream_url'] + stream_url = radio_api.internal_resolver(station) current_track = '' else: station = radio_api.get_station_by_station_id(