mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
c67d606f89
- Full playlist feature: overview grid, detail page with hero collage, tracklist DnD, song search, suggestions, context menu submenu - Audio: disable all app-level resampling — every track plays at its native sample rate (target_rate always 0 in audio_play + chain_next) - Fix: playlist hero bg flicker (memoize buildCoverArtUrl calls) - Fix: input focus double-border (search-input → .input class) - Polish: redesigned playlist search panel Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
610 B
TypeScript
24 lines
610 B
TypeScript
import { create } from 'zustand';
|
|
import { persist } from 'zustand/middleware';
|
|
|
|
interface PlaylistStore {
|
|
recentIds: string[];
|
|
touchPlaylist: (id: string) => void;
|
|
removeId: (id: string) => void;
|
|
}
|
|
|
|
export const usePlaylistStore = create<PlaylistStore>()(
|
|
persist(
|
|
(set) => ({
|
|
recentIds: [],
|
|
touchPlaylist: (id) =>
|
|
set((s) => ({
|
|
recentIds: [id, ...s.recentIds.filter((x) => x !== id)].slice(0, 50),
|
|
})),
|
|
removeId: (id) =>
|
|
set((s) => ({ recentIds: s.recentIds.filter((x) => x !== id) })),
|
|
}),
|
|
{ name: 'psysonic_playlists_recent' }
|
|
)
|
|
);
|