refactor(player): M0 — extract pure helpers from playerStore.ts (#554)

Moves four self-contained helpers into src/utils/, each with co-located
characterization tests. playerStore re-exports them for the ~30 existing
call sites; Phase E will migrate those imports.

  - shuffleArray              (Fisher-Yates, generic)
  - resolveReplayGainDb       (track/album/auto mode resolution)
  - songToTrack               (Subsonic -> Track shape)
  - buildInfiniteQueueCandidates  (Instant-Mix top-up source)

playerStore.ts: 3732 -> 3618 LOC (-114).
This commit is contained in:
Frank Stellmacher
2026-05-12 01:24:04 +02:00
committed by GitHub
parent 6afbdf9c60
commit d3a8160b37
11 changed files with 616 additions and 329 deletions
+6
View File
@@ -32,5 +32,11 @@ src/utils/dynamicColors.ts
src/utils/resolvePlaybackUrl.ts
src/utils/copyEntityShareLink.ts
# ── M0: pure helpers extracted from playerStore.ts (2026-05-12) ──────
src/utils/shuffleArray.ts
src/utils/resolveReplayGainDb.ts
src/utils/songToTrack.ts
src/utils/buildInfiniteQueueCandidates.ts
# ── stores (added as their tests grew past the floor) ────────────────
src/store/previewStore.ts