mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Feature: Support Multiple URLs in Studios (#6223)
* Backend support for studio URLs * FrontEnd addition * Support URLs in BulkStudioUpdate * Update tagger modal for URLs --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -1770,6 +1770,24 @@ func getStudioBoolValue(index int) bool {
|
||||
return index == 1
|
||||
}
|
||||
|
||||
func getStudioEmptyString(index int, field string) string {
|
||||
v := getPrefixedNullStringValue("studio", index, field)
|
||||
if !v.Valid {
|
||||
return ""
|
||||
}
|
||||
|
||||
return v.String
|
||||
}
|
||||
|
||||
func getStudioStringList(index int, field string) []string {
|
||||
v := getStudioEmptyString(index, field)
|
||||
if v == "" {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
return []string{v}
|
||||
}
|
||||
|
||||
// createStudios creates n studios with plain Name and o studios with camel cased NaMe included
|
||||
func createStudios(ctx context.Context, n int, o int) error {
|
||||
sqb := db.Studio
|
||||
@@ -1790,7 +1808,7 @@ func createStudios(ctx context.Context, n int, o int) error {
|
||||
tids := indexesToIDs(tagIDs, studioTags[i])
|
||||
studio := models.Studio{
|
||||
Name: name,
|
||||
URL: getStudioStringValue(index, urlField),
|
||||
URLs: models.NewRelatedStrings(getStudioStringList(i, urlField)),
|
||||
Favorite: getStudioBoolValue(index),
|
||||
IgnoreAutoTag: getIgnoreAutoTag(i),
|
||||
TagIDs: models.NewRelatedIDs(tids),
|
||||
|
||||
Reference in New Issue
Block a user