Skip to content

Commit

Permalink
fix speed state
Browse files Browse the repository at this point in the history
  • Loading branch information
kgarner7 committed Sep 29, 2024
1 parent c7214fc commit ecef9be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/renderer/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};

Expand Down
8 changes: 4 additions & 4 deletions src/renderer/store/player.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export interface PlayerState {
seek: boolean;
shuffledIndex: number;
song?: QueueSong;
speed: number;
status: PlayerStatus;
time: number;
};
Expand All @@ -32,6 +31,7 @@ export interface PlayerState {
};
repeat: PlayerRepeat;
shuffle: PlayerShuffle;
speed: number;
volume: number;
}

Expand Down Expand Up @@ -805,7 +805,7 @@ export const usePlayerStore = create<PlayerSlice>()(
},
setCurrentSpeed: (speed) => {
set((state) => {
state.current.speed = speed;
state.speed = speed;
});
},
setCurrentTime: (time, seek = false) => {
Expand Down Expand Up @@ -1011,7 +1011,6 @@ export const usePlayerStore = create<PlayerSlice>()(
seek: false,
shuffledIndex: 0,
song: {} as QueueSong,
speed: 1.0,
status: PlayerStatus.PAUSED,
time: 0,
},
Expand All @@ -1026,6 +1025,7 @@ export const usePlayerStore = create<PlayerSlice>()(
},
repeat: PlayerRepeat.NONE,
shuffle: PlayerShuffle.NONE,
speed: 1.0,
transcode: {
enabled: false,
},
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit ecef9be

Please sign in to comment.