mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
acdb0ae795
The persist middleware's `onRehydrateStorage` callback was ~100 LOC of legacy-shape migrations: hot-cache/preload mutual-exclusion reset, lyricsServerFirst+enableNeteaselyrics → lyricsSources one-time migration, Linux smooth-scroll one-shot, seekbar `'waveform'` → `'truewave'` rename, animationMode/reducedAnimations cruft strip, loudnessPreIsRefV1 reference recalibration, enableAppleMusicCoversDiscord → discordCoverSource enum migration, plus the sanitizers for mixMinRating / randomMixSize / skipStarManualSkipCountsByKey. Moved into `computeAuthStoreRehydration(state) → Partial<AuthState>` in `authStoreRehydrate.ts`; the store's callback is now a four-line wrapper. Pure code-move — same migration logic, same call order. authStore.ts: 270 → 158 LOC (−112). Total Phase-E-auth journey: 889 → 158 LOC (−82%). All non-trivial content is now out of the authStore body; what remains is state-init, 13 factory spreads, 2 derived getters, persist config, and the thin onRehydrate wrapper.