From 8517a9f9348cac198d6a7b5a56f0bc0b2a545c5e Mon Sep 17 00:00:00 2001 From: Tristen Allen <1288716+Spyboticsguy@users.noreply.github.com> Date: Tue, 14 Jul 2026 14:46:08 -0400 Subject: [PATCH] Unify scrobbling behavior across subsonic servers. (#2229) Small change that modifies the `scrobble` controller method to always limit sending a `scrobble` payload to the subsonic backend to cases where a scrobble is being submitted or a new song is being started. This is the current behavior for subsonic backends which support the `reportPlayback` backend (e.g., Navidrome). This change only modifies the behavior for other backends, which would receive `scrobble` notifications whenever a song changed for both the stopped song and the newly-started song. After this change, all subsonic backends now only receive a `scrobble` when a new song is started or when feishin is attempting to submit a scrobble. --- .../api/subsonic/subsonic-controller.ts | 41 +++++++------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/src/renderer/api/subsonic/subsonic-controller.ts b/src/renderer/api/subsonic/subsonic-controller.ts index 49733d841..12f28b789 100644 --- a/src/renderer/api/subsonic/subsonic-controller.ts +++ b/src/renderer/api/subsonic/subsonic-controller.ts @@ -2213,24 +2213,24 @@ export const SubsonicController: InternalControllerEndpoint = { scrobble: async (args) => { const { apiClientProps, query } = args; - if (hasFeature(apiClientProps.server, ServerFeature.REPORT_PLAYBACK)) { - if (query.submission || query.event === 'start') { - const res = await ssApiClient(apiClientProps).scrobble({ - query: { - id: query.id, - submission: query.submission, - }, - }); + if (query.submission || query.event === 'start') { + const res = await ssApiClient(apiClientProps).scrobble({ + query: { + id: query.id, + submission: query.submission, + }, + }); - if (res.status !== 200) { - throw new Error('Failed to scrobble'); - } - - if (query.submission) { - return null; - } + if (res.status !== 200) { + throw new Error('Failed to scrobble'); } + if (query.submission) { + return null; + } + } + + if (hasFeature(apiClientProps.server, ServerFeature.REPORT_PLAYBACK)) { const defaultParams = { ignoreScrobble: true, mediaId: query.id, @@ -2279,17 +2279,6 @@ export const SubsonicController: InternalControllerEndpoint = { return null; } - const res = await ssApiClient(apiClientProps).scrobble({ - query: { - id: query.id, - submission: query.submission, - }, - }); - - if (res.status !== 200) { - throw new Error('Failed to scrobble'); - } - return null; }, search: async (args) => {