mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
fix(playback): pin queue playback to source server when browsing another library (#717)
* fix(playback): pin queue streams, cover art, and library links to queue server When the active server changes while a queue from another server is playing, keep streams and UI on queueServerId; switch back for artist/album links and queue or player-bar context menus. * fix(playback): switch to queue server when opening Now Playing Ensure active server matches queueServerId before Subsonic fetches on the Now Playing page, mobile player route, and queue info panel; scope caches by server id. * docs(credits): mention Now Playing in PR #717 contribution line * fix(playback): route scrobble and queue sync to queue server Address PR review: apiForServer for scrobble/now-playing/savePlayQueue, clear queueServerId on server removal, mini-player queueServerId sync, block cross-server enqueue with toast, and regression tests.
This commit is contained in:
@@ -25,6 +25,7 @@ export interface MiniSyncPayload {
|
||||
track: MiniTrackInfo | null;
|
||||
queue: MiniTrackInfo[];
|
||||
queueIndex: number;
|
||||
queueServerId: string | null;
|
||||
isPlaying: boolean;
|
||||
volume: number;
|
||||
gaplessEnabled: boolean;
|
||||
@@ -62,6 +63,7 @@ function snapshot(): MiniSyncPayload {
|
||||
track: s.currentTrack ? toMini(s.currentTrack) : null,
|
||||
queue: (s.queue ?? []).map(toMini),
|
||||
queueIndex: s.queueIndex ?? 0,
|
||||
queueServerId: s.queueServerId ?? null,
|
||||
isPlaying: s.isPlaying,
|
||||
volume: s.volume,
|
||||
gaplessEnabled: !!a.gaplessEnabled,
|
||||
@@ -93,6 +95,7 @@ export function initMiniPlayerBridgeOnMain(): () => void {
|
||||
payload.track?.starred ?? '',
|
||||
(payload.track?.artists ?? []).map((a: SubsonicOpenArtistRef) => a.id ?? a.name).join('|'),
|
||||
payload.queueIndex,
|
||||
payload.queueServerId ?? '',
|
||||
payload.volume,
|
||||
payload.gaplessEnabled,
|
||||
payload.crossfadeEnabled,
|
||||
@@ -110,6 +113,7 @@ export function initMiniPlayerBridgeOnMain(): () => void {
|
||||
|| state.currentTrack?.starred !== prev.currentTrack?.starred
|
||||
|| state.queueIndex !== prev.queueIndex
|
||||
|| state.queue !== prev.queue
|
||||
|| state.queueServerId !== prev.queueServerId
|
||||
|| state.volume !== prev.volume) {
|
||||
push();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user