mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
42ef09f1e4
Add core seam store/mediaResolver.ts: a registry (registerMediaResolver) with delegating resolveAlbum/resolveArtist/resolvePlaylist + the pure auth wrappers resolveMediaServerId/resolveAlbumForActiveServer/resolveAlbumForServer and the ResolvedAlbum type. Default (unregistered) = network-only safety net (no library-index/offline branch — those stay in the feature). features/offline/utils/offlineMediaResolve keeps the offline-aware policy impls and registers them at module init (registerMediaResolver). The call runs at boot: AppShell eagerly imports the @/features/offline barrel, whose export * evaluates offlineMediaResolve. The 3 thin wrappers + ResolvedAlbum move to the core seam and are re-exported from offlineMediaResolve so the offline barrel still surfaces them for the ~25 UI consumers (unchanged). Repointed the 5 audio-core call sites (fetchTracksForSource, playAlbum, playArtistShuffled, playByOpaqueId, luckyMixHelpers) from @/features/offline to @/store/mediaResolver. Migrated playAlbum.test's mock to the new module via importOriginal-spread (keeps registerMediaResolver callable when the offline barrel loads transitively — partial-mock-collapse otherwise). Decouple Step 2b. The audio core's only remaining @/features/offline reference is now the type-only localPlaybackMigration import (erased). Runtime offline edge gone; orbit seam (Step 3) remains. tsc 0, lint 0, full suite 319/2353 green.