From 5d02f916c21a41be74141eed3ed9d36dc94f740c Mon Sep 17 00:00:00 2001 From: Gykes <24581046+Gykes@users.noreply.github.com> Date: Mon, 24 Nov 2025 13:58:57 -0800 Subject: [PATCH] Check for dupe IDs against boxes (#6309) --- pkg/models/stash_ids.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pkg/models/stash_ids.go b/pkg/models/stash_ids.go index 7751c2ef0..d761e959f 100644 --- a/pkg/models/stash_ids.go +++ b/pkg/models/stash_ids.go @@ -79,10 +79,23 @@ func (s StashIDInputs) ToStashIDs() StashIDs { return nil } - ret := make(StashIDs, len(s)) - for i, v := range s { - ret[i] = v.ToStashID() + // #2800 - deduplicate StashIDs based on endpoint and stash_id + ret := make(StashIDs, 0, len(s)) + seen := make(map[string]map[string]bool) + + for _, v := range s { + stashID := v.ToStashID() + + if seen[stashID.Endpoint] == nil { + seen[stashID.Endpoint] = make(map[string]bool) + } + + if !seen[stashID.Endpoint][stashID.StashID] { + seen[stashID.Endpoint][stashID.StashID] = true + ret = append(ret, stashID) + } } + return ret }