fix(orbit): bulk plays append instead of replacing the shared queue

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-04-24 15:11:08 +02:00
parent 3bbf628526
commit 59bae4b545
2 changed files with 23 additions and 1 deletions
+11
View File
@@ -1,6 +1,7 @@
import { getAlbum } from '../api/subsonic';
import { usePlayerStore } from '../store/playerStore';
import { songToTrack } from '../store/playerStore';
import { useOrbitStore } from '../store/orbitStore';
function fadeOut(setVolume: (v: number) => void, from: number, durationMs: number): Promise<void> {
return new Promise(resolve => {
@@ -28,6 +29,16 @@ export async function playAlbum(albumId: string): Promise<void> {
});
if (!tracks.length) return;
// In Orbit sessions, playAlbum is effectively an append operation (the
// playerStore bulk-gate also routes replaces into enqueue). Skip the
// fadeOut entirely — the current track keeps playing, the album goes
// onto the end of the queue after the user confirms the bulk dialog.
const orbitRole = useOrbitStore.getState().role;
if (orbitRole === 'host' || orbitRole === 'guest') {
usePlayerStore.getState().enqueue(tracks);
return;
}
const store = usePlayerStore.getState();
const { isPlaying, volume } = store;