mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Multiple image URLs (#4000)
* Backend changes - ported from scene impl * Front end changes * Refactor URL mutation code
This commit is contained in:
@@ -1113,6 +1113,19 @@ func getImageStringValue(index int, field string) string {
|
||||
return fmt.Sprintf("image_%04d_%s", index, field)
|
||||
}
|
||||
|
||||
func getImageNullStringPtr(index int, field string) *string {
|
||||
return getStringPtrFromNullString(getPrefixedNullStringValue("image", index, field))
|
||||
}
|
||||
|
||||
func getImageEmptyString(index int, field string) string {
|
||||
v := getImageNullStringPtr(index, field)
|
||||
if v == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return *v
|
||||
}
|
||||
|
||||
func getImageBasename(index int) string {
|
||||
return getImageStringValue(index, pathField)
|
||||
}
|
||||
@@ -1148,10 +1161,12 @@ func makeImage(i int) *models.Image {
|
||||
tids := indexesToIDs(tagIDs, imageTags[i])
|
||||
|
||||
return &models.Image{
|
||||
Title: title,
|
||||
Rating: getIntPtr(getRating(i)),
|
||||
Date: getObjectDate(i),
|
||||
URL: getImageStringValue(i, urlField),
|
||||
Title: title,
|
||||
Rating: getIntPtr(getRating(i)),
|
||||
Date: getObjectDate(i),
|
||||
URLs: models.NewRelatedStrings([]string{
|
||||
getImageEmptyString(i, urlField),
|
||||
}),
|
||||
OCounter: getOCounter(i),
|
||||
StudioID: studioID,
|
||||
GalleryIDs: models.NewRelatedIDs(gids),
|
||||
|
||||
Reference in New Issue
Block a user