mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Multiple scene URLs (#3852)
* Add URLs scene relationship * Update unit tests * Update scene edit and details pages * Update scrapers to use urls * Post-process scenes during query scrape * Update UI for URLs * Change urls label
This commit is contained in:
@@ -80,12 +80,10 @@ func (i *Importer) PreImport(ctx context.Context) error {
|
||||
|
||||
func (i *Importer) sceneJSONToScene(sceneJSON jsonschema.Scene) models.Scene {
|
||||
newScene := models.Scene{
|
||||
// Path: i.Path,
|
||||
Title: sceneJSON.Title,
|
||||
Code: sceneJSON.Code,
|
||||
Details: sceneJSON.Details,
|
||||
Director: sceneJSON.Director,
|
||||
URL: sceneJSON.URL,
|
||||
PerformerIDs: models.NewRelatedIDs([]int{}),
|
||||
TagIDs: models.NewRelatedIDs([]int{}),
|
||||
GalleryIDs: models.NewRelatedIDs([]int{}),
|
||||
@@ -93,6 +91,12 @@ func (i *Importer) sceneJSONToScene(sceneJSON jsonschema.Scene) models.Scene {
|
||||
StashIDs: models.NewRelatedStashIDs(sceneJSON.StashIDs),
|
||||
}
|
||||
|
||||
if len(sceneJSON.URLs) > 0 {
|
||||
newScene.URLs = models.NewRelatedStrings(sceneJSON.URLs)
|
||||
} else if sceneJSON.URL != "" {
|
||||
newScene.URLs = models.NewRelatedStrings([]string{sceneJSON.URL})
|
||||
}
|
||||
|
||||
if sceneJSON.Date != "" {
|
||||
d := models.NewDate(sceneJSON.Date)
|
||||
newScene.Date = &d
|
||||
|
||||
Reference in New Issue
Block a user