mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 23:35:44 +00:00
refactor(decouple): playback-engine bridge — break authStore→engine edges
The last core→engine inversions blocking the playback-core move live in the authStore settings/profile family: authServerProfileActions reads usePlayerStore.queueServerId + calls clearQueueServerForPlayback (on server delete), and authAudioSettingsActions calls usePlayerStore.updateReplayGainForCurrentTrack from ~8 ReplayGain/normalization setters. Both are re-exported through the authStore barrel, so a global store would depend on the (soon-to-move) engine. Add core seam store/playbackEngineBridge.ts: a registry exposing getQueueServerId / clearQueueServerForPlayback / updateReplayGainForCurrentTrack with no-op/null defaults. The engine registers its impls via store/playbackEngineBridgeRegister.ts (side-effect-imported by MainApp at boot). authStore actions now call the neutral delegators instead of importing the engine. Default is safe: the only callers are user-triggered settings/profile actions that fire long after boot (engine already registered); at boot there's no current track or queue binding, so the no-op would be correct anyway. authStore.servers.test imports the register module so removeServer's queue-clear runs through the real engine wiring. Prepares the playback-core move (Engine → features/playback): with this + keeping the 3 config-helper utils in utils/ + tolerating 2 type-only edges, the engine has no inbound core→feature inversions left. tsc 0, lint 0, suite 319/2353 green. Behavior-touching (server-delete queue clear, settings→gain refresh) → Frank QA.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { initAudioListeners } from '../store/initAudioListeners';
|
||||
import '../store/playbackEngineBridgeRegister'; // installs the playback-engine bridge at boot
|
||||
import { lazy, Suspense, useEffect, useState } from 'react';
|
||||
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
|
||||
Reference in New Issue
Block a user