segler-alex / radiobrowser-api-rust

radio-browser API implementation in rust
GNU Affero General Public License v3.0
227 stars 97 forks source link

advanced search - countrycode has no 'exact' option and results are not exact. #191

Closed BroTru closed 10 months ago

BroTru commented 1 year ago

Hi,

I'm looking at your 'advanced search' api (I'm working on a new java client for your service) and I noticed that you have parameters 'country' and 'countryExact' - and they work as expected but for a country code (especially important if the 'country' on a Station object is deprecated and country code usage is encouraged) there's just one parameter 'countrycode' - no 'countrycodeExact'. And - if I want to look for example by a codec and a country code - MP3 and PL - i get stations from Slovakia (countryCode=SK, country=Slovakia) as well. I tried to check if 'countryExact' works for that - but with no success. What I get in response for:

url: http://91.132.145.114/json/stations/search, pathParameter: null, postParameters: {codec=MP3, countryCode=PL, limit=100, countryExact=true} is (first two records) : tation{changeUuid=610cafba-71d8-40fc-bf68-1456ec973b9d, stationUuid=941ef6f1-0699-4821-95b1-2b678e3ff62e, name= Best FM, url=http://stream.bestfm.sk/128.mp3, urlResolved=http://stream.bestfm.sk/128.mp3, homepage=http://bestfm.sk/, favIcon=, tags=[], countryCode=SK, country=Slovakia, iso3166_2=null, state=, language=[], languageCodes=[], votes=40, lastChangeTime=2022-11-01T08:40:32Z, codec=MP3, bitrate=128, hls=false, lastcheckok=true, lastCheckTime=2023-06-19T20:54:41Z, lastCheckOkTime=2023-06-19T20:54:41Z, lastLocalCheckTime=2023-06-19T20:54:41Z, clickTimestamp=2023-06-20T11:13:15Z, clickcount=44, clicktrend=-1, sslError=0, geoLat=null, geoLong=null, hasExtendedInfo=false} Station{changeUuid=66536509-b54b-4a4e-8f39-bad1fdb6e539, stationUuid=9d69cc77-b698-40c0-8036-17cd1f09ca44, name= Fun Radio, url=http://stream.funradio.sk:8000/fun128.mp3, urlResolved=http://stream.funradio.sk:8000/fun128.mp3, homepage=http://www.funradio.sk/, favIcon=http://www.funradio.sk/img/logo/apple-icon-120x120.png?v=2022-11-24-1332, tags=[], countryCode=SK, country=Slovakia, iso3166_2=null, state=, language=[], languageCodes=[], votes=54, lastChangeTime=2023-02-19T08:31:32Z, codec=MP3, bitrate=128, hls=false, lastcheckok=true, lastCheckTime=2023-06-19T22:31:05Z, lastCheckOkTime=2023-06-19T22:31:05Z, lastLocalCheckTime=2023-06-19T22:31:05Z, clickTimestamp=2023-06-20T15:11:16Z, clickcount=85, clicktrend=-8, sslError=0, geoLat=null, geoLong=null, hasExtendedInfo=false}

It would be great for either the 'countrycode' work in an 'exact' way, or if there's another parameter - 'countrycodeExact' - as it is now for the country/countryExact pair. Finding stations from a specific country only using the 'countrycode' parameter is not possible in the advanced search.