update various player actions to reset timestamp to 0

This commit is contained in:
jeffvli
2025-11-13 13:34:47 -08:00
parent d2e6658c36
commit 1eb60f93e6
+5
View File
@@ -167,6 +167,7 @@ export const usePlayerStoreBase = create<PlayerState>()(
state.player.index = 0; state.player.index = 0;
state.player.status = PlayerStatus.PLAYING; state.player.status = PlayerStatus.PLAYING;
state.player.playerNum = 1; state.player.playerNum = 1;
state.player.timestamp = 0;
state.queue.default = newUniqueIds; state.queue.default = newUniqueIds;
if (state.player.shuffle === PlayerShuffle.TRACK) { if (state.player.shuffle === PlayerShuffle.TRACK) {
@@ -245,6 +246,7 @@ export const usePlayerStoreBase = create<PlayerState>()(
state.queue.default = []; state.queue.default = [];
state.player.status = PlayerStatus.PLAYING; state.player.status = PlayerStatus.PLAYING;
state.player.playerNum = 1; state.player.playerNum = 1;
state.player.timestamp = 0;
// Add the first item after the current playing track // Add the first item after the current playing track
@@ -569,6 +571,7 @@ export const usePlayerStoreBase = create<PlayerState>()(
set((state) => { set((state) => {
state.player.index = Math.min(queue.items.length - 1, currentIndex + 1); state.player.index = Math.min(queue.items.length - 1, currentIndex + 1);
state.player.playerNum = 1; state.player.playerNum = 1;
state.player.timestamp = 0;
}); });
}, },
mediaPause: () => { mediaPause: () => {
@@ -585,6 +588,7 @@ export const usePlayerStoreBase = create<PlayerState>()(
if (index !== -1) { if (index !== -1) {
state.player.index = index; state.player.index = index;
state.player.timestamp = 0;
} }
} }
@@ -597,6 +601,7 @@ export const usePlayerStoreBase = create<PlayerState>()(
set((state) => { set((state) => {
// Only decrement if we're not at the start // Only decrement if we're not at the start
state.player.index = Math.max(0, currentIndex - 1); state.player.index = Math.max(0, currentIndex - 1);
state.player.timestamp = 0;
}); });
}, },
mediaSeekToTimestamp: (timestamp: number) => { mediaSeekToTimestamp: (timestamp: number) => {