mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-12 15:22:35 +02:00
disable interval-based timeupdate scrobbles
This commit is contained in:
@@ -180,9 +180,6 @@ export const useScrobble = () => {
|
|||||||
|
|
||||||
const currentSong = usePlayerStore.getState().getCurrentSong();
|
const currentSong = usePlayerStore.getState().getCurrentSong();
|
||||||
const mediaType = currentSong?._itemType.includes('song') ? 'song' : 'podcast';
|
const mediaType = currentSong?._itemType.includes('song') ? 'song' : 'podcast';
|
||||||
const serverId = currentSong?._serverId;
|
|
||||||
const server = getServerById(serverId);
|
|
||||||
const hasPlaybackReport = hasFeature(server, ServerFeature.REPORT_PLAYBACK);
|
|
||||||
const useTicks = currentSong?._serverType === ServerType.JELLYFIN;
|
const useTicks = currentSong?._serverType === ServerType.JELLYFIN;
|
||||||
const currentStatus = usePlayerStore.getState().player.status;
|
const currentStatus = usePlayerStore.getState().player.status;
|
||||||
const currentTime = properties.timestamp;
|
const currentTime = properties.timestamp;
|
||||||
@@ -239,36 +236,36 @@ export const useScrobble = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send progress events every 10 seconds
|
// Send progress events every 10 seconds
|
||||||
if (hasPlaybackReport) {
|
// if (hasPlaybackReport) {
|
||||||
const timeSinceLastProgress = currentTime - lastProgressEventRef.current;
|
// const timeSinceLastProgress = currentTime - lastProgressEventRef.current;
|
||||||
if (timeSinceLastProgress >= 10) {
|
// if (timeSinceLastProgress >= 10) {
|
||||||
sendScrobble.mutate(
|
// sendScrobble.mutate(
|
||||||
{
|
// {
|
||||||
apiClientProps: { serverId: serverId || '' },
|
// apiClientProps: { serverId: serverId || '' },
|
||||||
query: {
|
// query: {
|
||||||
albumId: currentSong.albumId,
|
// albumId: currentSong.albumId,
|
||||||
event: 'timeupdate',
|
// event: 'timeupdate',
|
||||||
id: currentSong.id,
|
// id: currentSong.id,
|
||||||
mediaType: mediaType,
|
// mediaType: mediaType,
|
||||||
playbackRate,
|
// playbackRate,
|
||||||
position: getPositionValue(currentTime, useTicks),
|
// position: getPositionValue(currentTime, useTicks),
|
||||||
submission: false,
|
// submission: false,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
onSuccess: () => {
|
// onSuccess: () => {
|
||||||
logFn.debug(logMsg[LogCategory.SCROBBLE].scrobbledTimeupdate, {
|
// logFn.debug(logMsg[LogCategory.SCROBBLE].scrobbledTimeupdate, {
|
||||||
category: LogCategory.SCROBBLE,
|
// category: LogCategory.SCROBBLE,
|
||||||
meta: {
|
// meta: {
|
||||||
id: currentSong.id,
|
// id: currentSong.id,
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
lastProgressEventRef.current = currentTime;
|
// lastProgressEventRef.current = currentTime;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Check if we should submit scrobble based on listened time
|
// Check if we should submit scrobble based on listened time
|
||||||
if (!isCurrentSongScrobbledRef.current) {
|
if (!isCurrentSongScrobbledRef.current) {
|
||||||
|
|||||||
Reference in New Issue
Block a user