mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 04:20:07 +02:00
Improve MPV initialization and restore (#222)
- set mpv settings only after it has successfully started (at least on linux, settings were not taken) - change timing of restore queue to behave properly
This commit is contained in:
@@ -73,6 +73,7 @@ export const App = () => {
|
||||
|
||||
mpvPlayer?.volume(properties.volume);
|
||||
}
|
||||
mpvPlayer?.restoreQueue();
|
||||
};
|
||||
|
||||
if (isElectron() && playbackType === PlaybackType.LOCAL) {
|
||||
@@ -94,8 +95,6 @@ export const App = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (isElectron()) {
|
||||
mpvPlayer!.restoreQueue();
|
||||
|
||||
mpvPlayerListener!.rendererSaveQueue(() => {
|
||||
const { current, queue } = usePlayerStore.getState();
|
||||
const stateToSave: Partial<Pick<PlayerState, 'current' | 'queue'>> = {
|
||||
|
||||
@@ -701,6 +701,7 @@ export const usePlayerStore = create<PlayerSlice>()(
|
||||
state.current = {
|
||||
...state.current,
|
||||
...data.current,
|
||||
time: 0,
|
||||
};
|
||||
state.queue = {
|
||||
...state.queue,
|
||||
|
||||
Reference in New Issue
Block a user