fixed bug in SetShuffle

This commit is contained in:
Siiiiinth
2026-02-09 19:12:19 +01:00
parent d077bfb953
commit d463971ce8
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))