radiobrowser-api-rust
radiobrowser-api-rust copied to clipboard
When searching with offset, report total results count
Hey, in case I limit my search query like this: https://de1.api.radio-browser.info/json/stations/byname/npr?limit=10 How do I know the total results count without querying all stations?
Best regards, Jonas
It would be nice to know. Most queries you can just load all the results, or just initially load with limit and then all the rest. Couple thousand stations is only 250kb.
Here's an cool example of an API used in the Fyyd podcast database: https://api.fyyd.de/0.2/search/podcast?title=logbuch This query is searching for podcasts with the title "logbuch" and also shows some meta info about the query. Docu is here: https://github.com/eazyliving/fyyd-api
Looks like only way to get count is to do another sql query whiteout limit. stackoverflow
i am unsure how to handle this, i totally understand the need but i also do not want to double the load on the database ... :(
As an alternative, would it be possible to also expose a COUNT
endpoint? In theory, this could still be a doubling of load, but well-behaved clients can store the total count.