mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Fix alias issue when tagging performer from stash-box (#4820)
This commit is contained in:
@@ -29,3 +29,18 @@ func FromString(s string, sep string) []string {
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// Unique returns a slice containing only unique values from the provided slice.
|
||||
// The comparison is case-insensitive.
|
||||
func UniqueFold(s []string) []string {
|
||||
seen := make(map[string]struct{})
|
||||
var ret []string
|
||||
for _, v := range s {
|
||||
if _, exists := seen[strings.ToLower(v)]; exists {
|
||||
continue
|
||||
}
|
||||
seen[strings.ToLower(v)] = struct{}{}
|
||||
ret = append(ret, v)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user