feat(queue): move shuffle/loop controls into queue drawer, scoped to queue
This commit is contained in:
+12
-12
@@ -8,14 +8,8 @@
|
||||
* Server data (library/albums/…) is Tier 2 (see `rtkqPersist.ts`).
|
||||
*/
|
||||
import { instanceStorage } from '../config/instances';
|
||||
import {
|
||||
queueInitialState,
|
||||
type QueueState,
|
||||
} from './slices/queue';
|
||||
import {
|
||||
playerInitialState,
|
||||
type PlayerState,
|
||||
} from './slices/player';
|
||||
import { queueInitialState, type QueueState } from './slices/queue';
|
||||
import { playerInitialState, type PlayerState } from './slices/player';
|
||||
import type { RootState } from './index';
|
||||
|
||||
const QUEUE_KEY = 'queue';
|
||||
@@ -26,11 +20,17 @@ const PLAYER_KEY = 'player';
|
||||
// transient UI, so they are intentionally left out.
|
||||
type PersistedQueue = Pick<
|
||||
QueueState,
|
||||
'entries' | 'currentIndex' | 'source' | 'sourceId' | 'sourceName'
|
||||
| 'entries'
|
||||
| 'currentIndex'
|
||||
| 'source'
|
||||
| 'sourceId'
|
||||
| 'sourceName'
|
||||
| 'shuffle'
|
||||
| 'loop'
|
||||
>;
|
||||
type PersistedPlayer = Pick<
|
||||
PlayerState,
|
||||
'currentTrackId' | 'position' | 'volume' | 'muted' | 'repeat' | 'shuffle'
|
||||
'currentTrackId' | 'position' | 'volume' | 'muted'
|
||||
>;
|
||||
|
||||
function pickQueue(state: QueueState): PersistedQueue {
|
||||
@@ -40,6 +40,8 @@ function pickQueue(state: QueueState): PersistedQueue {
|
||||
source: state.source,
|
||||
sourceId: state.sourceId,
|
||||
sourceName: state.sourceName,
|
||||
shuffle: state.shuffle,
|
||||
loop: state.loop,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -49,8 +51,6 @@ function pickPlayer(state: PlayerState): PersistedPlayer {
|
||||
position: state.position,
|
||||
volume: state.volume,
|
||||
muted: state.muted,
|
||||
repeat: state.repeat,
|
||||
shuffle: state.shuffle,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user