fix(scrobble): use proper pause/unpause for seek, use ms for subsonic

This commit is contained in:
Kendall Garner
2026-05-31 21:13:11 -07:00
parent 70594a696b
commit 6aab8d4121
3 changed files with 5 additions and 4 deletions
@@ -2333,7 +2333,6 @@ export const SubsonicController: InternalControllerEndpoint = {
case 'start': case 'start':
state = 'starting'; state = 'starting';
break; break;
case 'timeupdate':
case 'unpause': case 'unpause':
state = 'playing'; state = 'playing';
break; break;
@@ -45,7 +45,7 @@ const getPositionValue = (seconds: number, useTicks: boolean) => {
return Math.round(seconds * 1e7); return Math.round(seconds * 1e7);
} }
return seconds; return seconds * 1000;
}; };
/* /*
@@ -459,12 +459,14 @@ export const useScrobble = () => {
lastProgressEventRef.current = properties.timestamp; lastProgressEventRef.current = properties.timestamp;
lastSeekEventRef.current = now; lastSeekEventRef.current = now;
const currentStatus = usePlayerStore.getState().player.status;
sendScrobble.mutate( sendScrobble.mutate(
{ {
apiClientProps: { serverId: currentSong._serverId || '' }, apiClientProps: { serverId: currentSong._serverId || '' },
query: { query: {
albumId: currentSong.albumId, albumId: currentSong.albumId,
event: 'timeupdate', event: currentStatus === PlayerStatus.PLAYING ? 'unpause' : 'pause',
id: currentSong.id, id: currentSong.id,
mediaType: mediaType, mediaType: mediaType,
playbackRate: playbackRate, playbackRate: playbackRate,
+1 -1
View File
@@ -1363,7 +1363,7 @@ export type ScrobbleArgs = BaseEndpointArgs & {
export type ScrobbleQuery = { export type ScrobbleQuery = {
albumId?: string; albumId?: string;
event?: 'pause' | 'start' | 'timeupdate' | 'unpause'; event?: 'pause' | 'start' | 'unpause';
id: string; id: string;
mediaType: 'podcast' | 'song'; mediaType: 'podcast' | 'song';
playbackRate: number; playbackRate: number;