From 1e9cc568f4aa329fe6f86f720571e63fd7378321 Mon Sep 17 00:00:00 2001 From: milaq Date: Sun, 21 Jul 2019 19:40:41 +0200 Subject: [PATCH] order stations in genres, countries and search results by name --- ycast/radiobrowser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ycast/radiobrowser.py b/ycast/radiobrowser.py index 9788daa..79e25e8 100644 --- a/ycast/radiobrowser.py +++ b/ycast/radiobrowser.py @@ -50,7 +50,7 @@ def get_station_by_id(uid): def search(name, limit=STATION_LIMIT): stations = [] - stations_json = request('stations/search?order=votes&reverse=true&bitrateMin=' + + stations_json = request('stations/search?order=name&reverse=true&bitrateMin=' + str(MINIMUM_BITRATE) + '&limit=' + str(limit) + '&name=' + str(name)) for station_json in stations_json: stations.append(Station(station_json)) @@ -79,7 +79,7 @@ def get_genres(): def get_stations_by_country(country, limit=STATION_LIMIT): stations = [] - stations_json = request('stations/search?order=votes&reverse=true&bitrateMin=' + + stations_json = request('stations/search?order=name&reverse=true&bitrateMin=' + str(MINIMUM_BITRATE) + '&limit=' + str(limit) + '&countryExact=true&country=' + str(country)) for station_json in stations_json: @@ -89,7 +89,7 @@ def get_stations_by_country(country, limit=STATION_LIMIT): def get_stations_by_genre(genre, limit=STATION_LIMIT): stations = [] - stations_json = request('stations/search?order=votes&reverse=true&bitrateMin=' + + stations_json = request('stations/search?order=name&reverse=true&bitrateMin=' + str(MINIMUM_BITRATE) + '&limit=' + str(limit) + '&tagExact=true&tag=' + str(genre)) for station_json in stations_json: stations.append(Station(station_json))