mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-21 22:15:40 +00:00
fix(player): cap persisted queue window (#756)
Playing/shuffling a big playlist set `queue` to ~10k `Track` objects. zustand `persist` then `JSON.stringify`'d the whole queue into `localStorage` on every persisted `set` → `QuotaExceededError` storm: playback never started and the main thread stalled on each write. `partialize` now persists only a ±250-track window around `queueIndex` (remapping the index into the slice) instead of the entire queue. The authoritative full queue lives server-side — synced via Subsonic `savePlayQueue` and restored through `getPlayQueue`. localStorage is only a fast local cache, so bounding it doesn't lose the queue; it just restores a ±250 window instantly while the full queue rehydrates from the server. Controlled before/after on a 10,509-track playlist: - before: QuotaExceededError ×9, play/shuffle dead - after: QuotaExceeded = 0, playback works
This commit is contained in:
@@ -205,6 +205,13 @@ const CONTRIBUTOR_ENTRIES = [
|
||||
'Search: queue pasted share links from live search (PR #551)',
|
||||
],
|
||||
},
|
||||
{
|
||||
github: 'artplan1',
|
||||
since: '1.46.0',
|
||||
contributions: [
|
||||
'Player: cap persisted queue to ±250-track window — fixes QuotaExceededError on large playlists (PR #756)',
|
||||
],
|
||||
},
|
||||
{
|
||||
github: 'Psychotoxical',
|
||||
since: '1.0.0',
|
||||
|
||||
Reference in New Issue
Block a user