|
@@ -105,7 +105,7 @@ def get_station_by_id(stationid, additional_info=False):
|
|
return my_stations.get_station_by_id(generic.get_stationid_without_prefix(stationid))
|
|
return my_stations.get_station_by_id(generic.get_stationid_without_prefix(stationid))
|
|
elif station_id_prefix == radiobrowser.ID_PREFIX:
|
|
elif station_id_prefix == radiobrowser.ID_PREFIX:
|
|
station = radiobrowser.get_station_by_id(generic.get_stationid_without_prefix(stationid))
|
|
station = radiobrowser.get_station_by_id(generic.get_stationid_without_prefix(stationid))
|
|
- if additional_info:
|
|
|
|
|
|
+ if station and additional_info:
|
|
station.get_playable_url()
|
|
station.get_playable_url()
|
|
return station
|
|
return station
|
|
return None
|
|
return None
|
|
@@ -123,7 +123,7 @@ def vtuner_redirect(url):
|
|
def upstream(path):
|
|
def upstream(path):
|
|
if request.args.get('token') == '0':
|
|
if request.args.get('token') == '0':
|
|
return vtuner.get_init_token()
|
|
return vtuner.get_init_token()
|
|
- if request.args.get('search'):
|
|
|
|
|
|
+ if request.args.get('search') or request.args.get('Search'):
|
|
return station_search()
|
|
return station_search()
|
|
if 'statxml.asp' in path and request.args.get('id'):
|
|
if 'statxml.asp' in path and request.args.get('id'):
|
|
return get_station_info()
|
|
return get_station_info()
|
|
@@ -238,15 +238,20 @@ def radiobrowser_popular():
|
|
methods=['GET', 'POST'])
|
|
methods=['GET', 'POST'])
|
|
def station_search():
|
|
def station_search():
|
|
query = request.args.get('search')
|
|
query = request.args.get('search')
|
|
|
|
+ if not query:
|
|
|
|
+ query = request.args.get('Search')
|
|
if not query or len(query) < 3:
|
|
if not query or len(query) < 3:
|
|
page = vtuner.Page()
|
|
page = vtuner.Page()
|
|
page.add(vtuner.Display("Search query too short"))
|
|
page.add(vtuner.Display("Search query too short"))
|
|
page.set_count(1)
|
|
page.set_count(1)
|
|
return page.to_string()
|
|
return page.to_string()
|
|
|
|
+ station = get_station_by_id(query, additional_info=(not station_tracking))
|
|
|
|
+ if station:
|
|
|
|
+ stations = [station]
|
|
else:
|
|
else:
|
|
# TODO: we also need to include 'my station' elements
|
|
# TODO: we also need to include 'my station' elements
|
|
stations = radiobrowser.search(query)
|
|
stations = radiobrowser.search(query)
|
|
- return get_stations_page(stations, request).to_string()
|
|
|
|
|
|
+ return get_stations_page(stations, request).to_string()
|
|
|
|
|
|
|
|
|
|
@app.route('/' + PATH_ROOT + '/' + PATH_PLAY,
|
|
@app.route('/' + PATH_ROOT + '/' + PATH_PLAY,
|