mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Generate content for specific scenes (#672)
* Add UI dialog for scene(s) * Move preview preset to config
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package utils
|
||||
|
||||
import "strconv"
|
||||
|
||||
// https://gobyexample.com/collection-functions
|
||||
|
||||
func StrIndex(vs []string, t string) int {
|
||||
@@ -32,3 +34,15 @@ func StrMap(vs []string, f func(string) string) []string {
|
||||
}
|
||||
return vsm
|
||||
}
|
||||
|
||||
// StringSliceToIntSlice converts a slice of strings to a slice of ints. If any
|
||||
// values cannot be parsed, then they are inserted into the returned slice as
|
||||
// 0.
|
||||
func StringSliceToIntSlice(ss []string) []int {
|
||||
ret := make([]int, len(ss))
|
||||
for i, v := range ss {
|
||||
ret[i], _ = strconv.Atoi(v)
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user