[bugfix]: restart timestamp when adding to queue
This commit is contained in:
parent
c5e8472746
commit
168153b211
1 changed files with 10 additions and 0 deletions
|
@ -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 a new issue