fixed bug in SetShuffle

This commit is contained in:
Siiiiinth
2026-02-15 09:29:48 -08:00
committed by Drew Weymouth
parent d59d7ac529
commit ad18e304d5
2 changed files with 34 additions and 17 deletions
+3
View File
@@ -112,6 +112,9 @@ func TracksToIDs(tracks []*mediaprovider.Track) []string {
// Reorder items and return a new track slice.
// idxToMove must contain only valid indexes into tracks, and no repeats
func ReorderItems[T any](items []T, idxToMove []int, insertIdx int) []T {
if len(items) < 2 {
return items
}
idxToMoveSet := ToSet(idxToMove)
newItems := make([]T, 0, len(items))