mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +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:
@@ -217,7 +217,6 @@ func (i *Importer) Update(ctx context.Context, id int) error {
|
||||
func studioJSONtoStudio(studioJSON jsonschema.Studio) models.Studio {
|
||||
newStudio := models.Studio{
|
||||
Name: studioJSON.Name,
|
||||
URL: studioJSON.URL,
|
||||
Aliases: models.NewRelatedStrings(studioJSON.Aliases),
|
||||
Details: studioJSON.Details,
|
||||
Favorite: studioJSON.Favorite,
|
||||
@@ -229,6 +228,19 @@ func studioJSONtoStudio(studioJSON jsonschema.Studio) models.Studio {
|
||||
StashIDs: models.NewRelatedStashIDs(studioJSON.StashIDs),
|
||||
}
|
||||
|
||||
if len(studioJSON.URLs) > 0 {
|
||||
newStudio.URLs = models.NewRelatedStrings(studioJSON.URLs)
|
||||
} else {
|
||||
urls := []string{}
|
||||
if studioJSON.URL != "" {
|
||||
urls = append(urls, studioJSON.URL)
|
||||
}
|
||||
|
||||
if len(urls) > 0 {
|
||||
newStudio.URLs = models.NewRelatedStrings(urls)
|
||||
}
|
||||
}
|
||||
|
||||
if studioJSON.Rating != 0 {
|
||||
newStudio.Rating = &studioJSON.Rating
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user