From ed6baa692e12e77b3f730972e3c68388cab42ecb Mon Sep 17 00:00:00 2001 From: milaq Date: Sat, 17 Aug 2019 23:59:50 +0200 Subject: [PATCH] Radiobrowser: Limit search results --- ycast/radiobrowser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ycast/radiobrowser.py b/ycast/radiobrowser.py index faf5271..d1802c1 100644 --- a/ycast/radiobrowser.py +++ b/ycast/radiobrowser.py @@ -49,10 +49,10 @@ def get_station_by_id(uid): return Station(station_json[0]) -def search(name): +def search(name, limit=DEFAULT_STATION_LIMIT): stations = [] stations_json = request('stations/search?order=name&reverse=false&bitrateMin=' + - str(MINIMUM_BITRATE) + '&name=' + str(name)) + str(MINIMUM_BITRATE) + '&limit=' + str(limit) + '&name=' + str(name)) for station_json in stations_json: stations.append(Station(station_json)) return stations