Skip to content

Commit

Permalink
Version 3.0.1 (backports)
Browse files Browse the repository at this point in the history
  • Loading branch information
enen92 committed Apr 13, 2020
1 parent 50380a5 commit 6949d25
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
9 changes: 3 additions & 6 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<addon id="plugin.audio.radio_de" name="Radio" provider-name="Tristan Fischer, enen92" version="3.0.0">
<addon id="plugin.audio.radio_de" name="Radio" provider-name="Tristan Fischer, enen92" version="3.0.1">
<requires>
<import addon="xbmc.python" version="2.14.0" />
<import addon="script.module.xbmcswift2" version="2.5.0" />
Expand All @@ -12,11 +12,8 @@
<source>https://github.com/XBMC-Addons/plugin.audio.radio_de</source>
<forum>https://forum.kodi.tv/showthread.php?tid=119362</forum>
<license>GPL-2.0-only</license>
<news>3.0.0 (12/4/2020)
[fix] playlist based stations (backport)
[fix] ratings (backport)
[new] removed python3 compatibility
[new] automated submissions to repository
<news>3.0.1 (13/4/2020)
- [new] Use internal playlist resolver also in custom stations (backport)
</news>
<summary lang="be">Access &gt;7000 radio broadcasts</summary>
<summary lang="ca">accedeix a mes de 7000 emissores de radio</summary>
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
19 changes: 18 additions & 1 deletion resources/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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') % (
Expand Down Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6949d25

Please sign in to comment.