fix speed state

This commit is contained in:
Kendall Garner 2024-09-29 16:16:33 -07:00
parent c7214fc7ce
commit ecef9bea5e
No known key found for this signature in database
GPG Key ID: 18D2767419676C87
2 changed files with 5 additions and 5 deletions

View File

@ -143,7 +143,7 @@ export const App = () => {
if (!isRunning) {
const extraParameters = useSettingsStore.getState().playback.mpvExtraParameters;
const properties: Record<string, any> = {
speed: usePlayerStore.getState().current.speed,
speed: usePlayerStore.getState().speed,
...getMpvProperties(useSettingsStore.getState().playback.mpvProperties),
};

View File

@ -18,7 +18,6 @@ export interface PlayerState {
seek: boolean;
shuffledIndex: number;
song?: QueueSong;
speed: number;
status: PlayerStatus;
time: number;
};
@ -32,6 +31,7 @@ export interface PlayerState {
};
repeat: PlayerRepeat;
shuffle: PlayerShuffle;
speed: number;
volume: number;
}
@ -805,7 +805,7 @@ export const usePlayerStore = create<PlayerSlice>()(
},
setCurrentSpeed: (speed) => {
set((state) => {
state.current.speed = speed;
state.speed = speed;
});
},
setCurrentTime: (time, seek = false) => {
@ -1011,7 +1011,6 @@ export const usePlayerStore = create<PlayerSlice>()(
seek: false,
shuffledIndex: 0,
song: {} as QueueSong,
speed: 1.0,
status: PlayerStatus.PAUSED,
time: 0,
},
@ -1026,6 +1025,7 @@ export const usePlayerStore = create<PlayerSlice>()(
},
repeat: PlayerRepeat.NONE,
shuffle: PlayerShuffle.NONE,
speed: 1.0,
transcode: {
enabled: false,
},
@ -1130,7 +1130,7 @@ export const useVolume = () => usePlayerStore((state) => state.volume);
export const useMuted = () => usePlayerStore((state) => state.muted);
export const useSpeed = () => usePlayerStore((state) => state.current.speed);
export const useSpeed = () => usePlayerStore((state) => state.speed);
export const usePlayerFallback = () => usePlayerStore((state) => state.fallback);