Files
Psychotoxical-psysonic/src/store/playlistStore.ts
T
Psychotoxical c67d606f89 feat: v1.24.0 — Playlist Management, native sample rate playback
- 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>
2026-03-31 23:14:15 +02:00

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' }
)
);