mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-08 03:30:01 +02:00
Highlight the playlist in the left panel on play (#2025)
* Fixed bad smart playlist field s * first try to add playlist highlight * Simplified calls * Now works for grids too. * Derive the playlist highlight from the currently-playing track's origin instead of a stale global field. * addressed comments
This commit is contained in:
@@ -1640,6 +1640,7 @@ export const usePlayerStoreBase = createWithEqualityFn<PlayerState>()(
|
||||
const excludedPlayerKeys = ['playerNum', 'seekToTimestamp', 'status'];
|
||||
|
||||
// If we're not restoring the play queue, we don't need the index property
|
||||
// (it is meaningless without the queue)
|
||||
if (!shouldRestorePlayQueue) {
|
||||
excludedPlayerKeys.push('index');
|
||||
}
|
||||
@@ -2076,6 +2077,7 @@ export const updateQueueSong = (songId: string, updatedSong: Song) => {
|
||||
const uniqueId = song._uniqueId;
|
||||
state.queue.songs[song._uniqueId] = {
|
||||
...updatedSong,
|
||||
_contextPlaylistId: song._contextPlaylistId,
|
||||
_uniqueId: uniqueId,
|
||||
};
|
||||
}
|
||||
@@ -2083,6 +2085,10 @@ export const updateQueueSong = (songId: string, updatedSong: Song) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const useCurrentPlaylistContextId = () => {
|
||||
return usePlayerStoreBase((state) => state.getCurrentSong()?._contextPlaylistId ?? null);
|
||||
};
|
||||
|
||||
export const usePlayerMuted = () => {
|
||||
return usePlayerStoreBase((state) => state.player.muted);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user