mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-17 08:54:27 +02:00
fix(scrobble): use proper pause/unpause for seek, use ms for subsonic
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user