Add clarifiaction on result of scrobble#202
Conversation
✅ Deploy Preview for opensubsonic ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Implements OpenSubsonic API clarification from PR #202: the scrobble endpoint now validates all media file IDs before processing and returns error code 70 (data not found) if any ID is invalid. This ensures the entire operation fails atomically - no scrobbles are submitted when any ID in the batch is invalid, matching the OpenSubsonic specification. Changes include updating MediaFileRepository.Exists() to accept variadic IDs for efficient batch validation via a single COUNT query. See: opensubsonic/open-subsonic-api#202 Signed-off-by: Deluan <deluan@navidrome.org>
|
Unfortunately that's not how it works :) We can't just clarify things if all the servers are not on page else the docs says X and the servers do Y and this breaks the purpose of OpenSubsonic. If you can get all subsonic servers onboard to actually do that before merging this then why not. |
|
EDIT: As pointed out below, I actually think that processing the valid scrobbles, and silently ignoring the failing ones is a simpler and better approach. |
39330c1 to
f677b86
Compare
|
I'm willing to update Nextcloud Music to follow this specification. |
|
From the point of view of a client who has stored offline dozens of scrobbles. |
|
In my case I always send 1 by 1 to be sure the data is properly synced when back online, and rely on the error 70 to stop trying as I know the track is no more on the server and not a temporary issue that I'll retry later. |
I think this is up to the client to decide. If I was implementing it, I'd do:
Thinking more about this, maybe the simpler implementation of always return success make sense: If the client is well implemented, this should only happen when the music file is gone, and in that case any errors could be safely ignored. |
|
play:Sub chiming in here: Failing otherwise good scrobbles and requiring a fallback to scrobbling 1 by 1 will mean more complex/errorprone implementation with little gains to show for it. I'm in the pragmatic camp here, and believe that succeeding the scrobbles that are ok, while silently failing the others are the way to go in this case. |
|
Maybe the clarification should be along the lines of:
|
If going down this road, I would rather just specify
There's really no reason to separate the single/multi cases here because the single-id is just a one-item-list and already sufficiently handled by the generic rules. |
This is the way i would do it. right now i ignore missing items entirely so it's always successful which is a throwback to last.fm using title, artist, album for submission. technically it was submitted successfully, just didn't find anything. Most submissions will be singles and this is submitted by ID so a fail on all submitted would be the way. There are a few things like this in the API that have a subsonic way that i'm not always aware of so this is a good thing to do. |
| {{< /tab >}} | ||
| {{< /tabpane >}} | ||
|
|
||
| If any `id` is invalid the result is an empty [`subsonic-response`](../../responses/subsonic-response) with error code 70 "The requested data was not found". Note that in this case the whole request has failed and no scrobbling should be performed for those `id` which are valid. |
There was a problem hiding this comment.
"If all id values are invalid" and you would get this pull through
|
Hi there, what is happening with this PR? |
This PR adds the clarification discussed in #201: