use initial index for shuffling when availabe

This commit is contained in:
Kendall Garner 2025-07-02 20:48:45 -07:00
parent 039d008223
commit 055d9ac5c1
No known key found for this signature in database
GPG key ID: 9355F387FE765C94
2 changed files with 22 additions and 8 deletions

View file

@ -75,7 +75,9 @@ export const useHandlePlayQueueAdd = () => {
if (!server) return toast.error({ message: 'No server selected', type: 'error' });
const { byData, byItemType, initialIndex, initialSongId, playType, query } = options;
let songs: null | QueueSong[] = null;
let initialSongIndex = 0;
// Allow this to be undefined for "play shuffled". If undefined, default to 0,
// otherwise, choose the selected item in the queue
let initialSongIndex: number | undefined;
if (byItemType) {
let songList: SongListResponse | undefined;