mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
[bugfix]: restart timestamp when adding to queue
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
|||||||
} from '/@/renderer/features/player/utils';
|
} from '/@/renderer/features/player/utils';
|
||||||
import { queryKeys } from '/@/renderer/api/query-keys';
|
import { queryKeys } from '/@/renderer/api/query-keys';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { PlayersRef } from '/@/renderer/features/player/ref/players-ref';
|
||||||
|
|
||||||
const getRootQueryKey = (itemType: LibraryItem, serverId: string) => {
|
const getRootQueryKey = (itemType: LibraryItem, serverId: string) => {
|
||||||
let queryKey;
|
let queryKey;
|
||||||
@@ -179,6 +180,15 @@ export const useHandlePlayQueueAdd = () => {
|
|||||||
} else {
|
} else {
|
||||||
mpvPlayer!.setQueueNext(playerData);
|
mpvPlayer!.setQueueNext(playerData);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
const player =
|
||||||
|
playerData.current.player === 1
|
||||||
|
? PlayersRef.current?.player1
|
||||||
|
: PlayersRef.current?.player2;
|
||||||
|
const underlying = player?.getInternalPlayer();
|
||||||
|
if (underlying) {
|
||||||
|
underlying.currentTime = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We should only play if the queue was empty, or we are doing play NOW
|
// We should only play if the queue was empty, or we are doing play NOW
|
||||||
|
|||||||
Reference in New Issue
Block a user