From f7c33da0856071039fb41a4a051e452d2573112f Mon Sep 17 00:00:00 2001 From: Siiiiinth <60766886+Siiiiinth@users.noreply.github.com> Date: Sun, 15 Feb 2026 21:06:59 +0100 Subject: [PATCH] reorderItems returns a copy now --- sharedutil/sharedutil.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sharedutil/sharedutil.go b/sharedutil/sharedutil.go index 0e4051e..3a13a29 100644 --- a/sharedutil/sharedutil.go +++ b/sharedutil/sharedutil.go @@ -113,7 +113,9 @@ func TracksToIDs(tracks []*mediaprovider.Track) []string { // 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 + cpy := make([]T, len(items)) + copy(cpy, items) + return cpy } idxToMoveSet := ToSet(idxToMove)