mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Multiple image URLs (#4000)
* Backend changes - ported from scene impl * Front end changes * Refactor URL mutation code
This commit is contained in:
@@ -62,8 +62,6 @@ func (i *Importer) PreImport(ctx context.Context) error {
|
||||
|
||||
func (i *Importer) imageJSONToImage(imageJSON jsonschema.Image) models.Image {
|
||||
newImage := models.Image{
|
||||
// Checksum: imageJSON.Checksum,
|
||||
// Path: i.Path,
|
||||
PerformerIDs: models.NewRelatedIDs([]int{}),
|
||||
TagIDs: models.NewRelatedIDs([]int{}),
|
||||
GalleryIDs: models.NewRelatedIDs([]int{}),
|
||||
@@ -81,9 +79,12 @@ func (i *Importer) imageJSONToImage(imageJSON jsonschema.Image) models.Image {
|
||||
if imageJSON.Rating != 0 {
|
||||
newImage.Rating = &imageJSON.Rating
|
||||
}
|
||||
if imageJSON.URL != "" {
|
||||
newImage.URL = imageJSON.URL
|
||||
if len(imageJSON.URLs) > 0 {
|
||||
newImage.URLs = models.NewRelatedStrings(imageJSON.URLs)
|
||||
} else if imageJSON.URL != "" {
|
||||
newImage.URLs = models.NewRelatedStrings([]string{imageJSON.URL})
|
||||
}
|
||||
|
||||
if imageJSON.Date != "" {
|
||||
d, err := models.ParseDate(imageJSON.Date)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user