-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative add totalCount extension #107
base: main
Are you sure you want to change the base?
Conversation
add for `offset` and `count` parameters that make sense * Endpoints * getalbumlist * getalbumlist2 * getnewestpodcasts * getsimilarsongs * getsimilarsongs2 * getsongsbygenre * gettopsongs * search3 * Responses * albumList * albumList2 * newestPodcasts * searchResult3 * similarSongs * similarSongs2 * songsByGenre * topSongs Search3 responses prefix totalCount for each object type add note for unknown, uncalculated, unsupported values tag [OS] Update searchResult3.md Update songsByGenre.md
simplified approach
✅ Deploy Preview for opensubsonic ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@deluan will you actually implement totalCount for search3? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As search3
has counts, search2
should also have totalArtistCount
/totalAlbumCount
/totalSongCount
(since there are servers which also provide separate search2
/search3
)
I haven't, but I think it makes sense to be in the spec, as long as it can be set to -1 |
Yeah, I agree |
I really think we need a parameter for the client to request
|
Reposting here a remark from the other one. But For the new param again, IMO this is going backward on the purpose of OS and would require an extension.
So the only "issue" with this temporary solution is the cost it triggers, and since servers would only put it when the cost is low this is not really a problem. Now let's again take your example:
With current API this is the only thing that can be done, you can't search and order, you can't sort by anything, there's so many limitations in that API that pagination with the filters is quite frankly too limited to be really usefull. Hence the need for the new proper endpoints that are not complicated to build, it just requires someone to gather all the needs from the discussion post and start consolidating. Then building the API is actually quite simple. |
This is a problem if servers choose to put it when the cost is high, and potentially a problem if servers don't put it for some requests where a paginated client required it. Maybe we have to wait to hear from a paginated client dev if it would break the usefulness for them if |
For the second part again: So client side without an extension this does not change anything at all. For the server side from the currently exposed pov it seems they would not add the field on the costly ones and since this is a temporary solution, this may just motivate more to build the new endpoints. Pagination with very limited filtering and no sorts, is very limiting for the clients anyway. And so to resume again the So client side without an extension this does not change anything at all. is also the perfect example of why the new endpoints are more useful, because it allows clients to actually build something proper and working all the times for recent OS servers, instead of hacking quick things on older endpoints that does not offer half the things a modern client would want anyway. |
IMHO, we should make this an extension and remove the |
Rather than hoping that |
Well the extension could be to just allow a |
So let's go backwards and build on broken API to have clients limited by the currently very limited API instead of adding the proper extension and endpoints allowing clients to directly build everything they need. A getAllAlbums endpoint with sort,filter and pagination is not at all the same effect than returning a count in getAlbumList2. Let's try to see the big picture and what this opens and what clients will be able to provide with this. The compare with the proper solution. Then see how much work for clients and server lost to support both for 0 gains. IMO again adding the field as temporary solution is OK. Building an extension to add something ultra limited is not OK in the grand scheme of OS. |
It's not OK for clients if they can't rely on when a server will return a valid count vs -1, and also not OK for clients if servers have to return it for expensive queries. If we document that servers only return the count for things like an unfiltered |
I agree and one extension (totalCount), does not exclude a proper pagination extension in the future. EDIT:
|
But again only reading half what I write I should maybe write less. How adding totalCount to albums solves the need for pagination for artists, songs and genres ? We basically define an extension for 2 endpoints that will require a lot of things for servers and clients and completely useless for artists, songs and genres? How is this something proper for a project who's purpose is to build proper APIs and enhance things. In a couple of weeks, we define the new proper extension and endpoints and then what server and clients redo everything ? It's been 10 years the API is like that, but somehow now there's an ultra urgency to provide something ultra limited when there was 0 reaction to work on the proper end points? |
On the server it is literally a 17 loc middleware: https://github.com/navidrome/navidrome/blob/a9334b7787bd4cfe18bb329654e28b0702004127/server/subsonic/middlewares.go#L27-L43. I can't imagine it being that complicated on the client, as it is very localized. totalCounts on the other hand, will drive different UX on the clients, and the server will have to add this to a bunch of endpoints, and possibly cache queries for better performance. It is a much more complicated implementation in all aspects.
It doesn't, but IMO this half-baked solution is not good enough for most applications, and it gets worse if clients need to handle different UX depending on the result of a bunch of queries in different places, instead of a upfront query to
Couple of weeks? You are kidding, right? Who is trolling who now?
I actually prefer a proper extension than this thing here, I'm just trying to echo what I hear from client devs, and how this is a immediate pain for most. I'm talking about new clients (Feishin, Supersonic, Stream Audio..), and online-first clients. Most apps from 10 years ago have a outdated UI/UX and don't care about this. Ok, that's my 96 cents. I won't say anything else. You see, my position as a server dev is very comfortable. I can do whatever the clients want/need. Just let me know. EDIT: by the way, 1 more cent, and I'll shut up.
When we decided to not bump the version and write a new API, we were bound to have this Frankenstein, sooner or later. I think everyone was aware of that. |
Yes it is it someone start it. We already have most needs. We can totally ignore the pagination continuation token and use the totalCount query param and a random seed param to solve the random issue. Not perfect but works without much changes. About all the new client do they really only want pagination for albums without being able to offer the same interface to artists and songs ?
Is exactly the reason why only having thing for albums and ultra limited does not make sense. No sorting? No proper filtering? Only albums? So again what does users and clients want ? That's what we should try to solve in a proper way, not make their life more complicated with things that will change as soon as they will require the other endpoint with pagination.
Both are kinda contradictory, building a complete different screen and navigation that only covers a little part of the UI is neither simple not logical, specially is they need to redo all later. Edit:
Confirms what I say and that this is not a good idea.
This have literally 0 relationship with the utility, globalness and purpose of the definition of an API. |
Maybe we want to hold off on totalCount entirely then until the larger pagination API is proposed? |
If some persons are against the current proposal (with the small search2 add getnewestpodcasts removal) and want an extension for this temporary proposal then yes I think it's better for OS. I still think that the field returned on the non slow path could help some clients to start improving their UI without fully switching to the future solution. But only clients can tell (In all cases since those totals are very limited in their scope, clients should also tell more about such values being useful only here and if they'd add new pagination system for only albums) |
Hi, what's the next steps here? Are people generally good with this as a first step? Or are people willing to commit time to provide full refinements? |
This is good as a first step as long as it's not an turned into an extension. |
As discussed in #16
Adda totalCount to the following
note Search3 responses prefix totalCount for each object type (totalAlbumCount, totalArtistCount, totalSongCount)