sfuhrm / radiobrowser4j

RadioBrowser Java API library
Other
50 stars 8 forks source link

The returned content is not filtered according to parameters #117

Closed ChildProdigy closed 3 months ago

ChildProdigy commented 3 months ago

Parameter parameter = new Parameter() { @Override protected void apply(Map<String, String> requestParams) { requestParams.put("countrycode", "CN"); }};

List stations = radioBrowser.listStations(Paging.at(0, 10), parameter);

The returned content is not filtered according to parameters

sfuhrm commented 3 months ago

You are trying to get a list of stations in country China. The listStations() call that you're using is documented to "Get a list of all stations." 1, and that's what it's doing.

What you're looking for is either

List<Station> stations = rb.listStationsBy(Paging.at(0, 10), SearchMode.BYCOUNTRYCODEEXACT, "CN");

or listStationsWithAdvancedSearch() if you want to search with multiple filters.

Hope this is working for you better.