mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
refactor(queue): track resolver + selectors (thin-state phase 2) (#859)
* refactor(queue): add queue track resolver (thin-state phase 2a) Standalone resolver: QueueItemRef → Track via index batch (library_get_tracks_batch, ≤100/call) → network getSong fallback (P8), into a bounded LRU cache. Holds raw tracks; session star/rating overrides (F4) merged on read via applyQueueOverrides. Sync getCachedTrack + subscribeQueueResolver for selectors; resolveVisibleRange prefetches a [-50, +200] window; carries queue-only flags from refs; invalidate drops entries after a sync succeeds. Not wired into the store/UI yet — phase 2b does that. * refactor(queue): extract toQueueItemRefs helper Pure helper deriving thin QueueItemRefs from a Track[] queue (per-item serverId, queue-only flags), shared by the persist partialize and the upcoming phase-2b resolver bridge. No behaviour change. * refactor(queue): resolver bridge + queue selectors (thin-state phase 2b) Seed the resolver cache from the canonical queue (queueResolverBridge, a windowed [-50, +200] seed around the current index) and add the stable queue selectors (useQueueTrackAt / useCurrentTrack / useQueueItems). Additive: the store stays queue: Track[]-canonical; consumers migrate onto the selectors in phase 3, and the selector impls move to the resolver once queue: Track[] is dropped in phase 4. No mutation or persist change — the persisted queueItems keeps its single restore role (no dual-role clash). * docs(changelog): on-demand queue track loading groundwork (#859)
This commit is contained in:
committed by
GitHub
parent
d15e270499
commit
090a31bc82
@@ -54,6 +54,7 @@ import { useAuthStore } from '../store/authStore';
|
||||
import { useOfflineStore } from '../store/offlineStore';
|
||||
import { usePlayerStore } from '../store/playerStore';
|
||||
import '../store/previewPlayerVolumeSync';
|
||||
import '../store/queueResolverBridge';
|
||||
import { useThemeStore } from '../store/themeStore';
|
||||
import { useFontStore } from '../store/fontStore';
|
||||
import { useEqStore } from '../store/eqStore';
|
||||
|
||||
Reference in New Issue
Block a user