Commit Graph

1 Commits

Author SHA1 Message Date
Frank Stellmacher b8ddb09b78 refactor(auth): E.44 — extract server-profile + lastfm + audio-settings factories (#609)
Three action-factories peel ~25 setters out of the authStore body,
following the playerStore action-factory pattern from Phase E:

- `createServerProfileActions` — `addServer`, `updateServer`,
  `removeServer` (the non-trivial one — drops every per-server map
  entry for the removed id), `setServers`, `setActiveServer`,
  `setLoggedIn`, `setConnecting`, `setConnectionError`, `logout`.
- `createAuthLastfmActions` — credentials + session connect/disconnect
  + error flag + master scrobbling toggle. Network calls (love /
  scrobble) stay in the playerStore-side `lastfmActions.ts`.
- `createAudioSettingsActions` — replay-gain / normalization /
  loudness mode toggles (each calls `usePlayerStore.getState()
  .updateReplayGainForCurrentTrack()` so a running track catches up),
  plus crossfade / gapless / hi-res / audio-output (no engine
  callback needed).

Pure code-move; no behaviour change. authStore.ts: 518 → 428 LOC (−90).
2026-05-12 23:30:28 +02:00