Check for dupe IDs against boxes (#6309)

This commit is contained in:
Gykes 2025-11-24 13:58:57 -08:00 committed by GitHub
parent e176cf5f71
commit 5d02f916c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}