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:
@@ -13,12 +13,12 @@ type Image struct {
|
||||
|
||||
Title string `json:"title"`
|
||||
// Rating expressed in 1-100 scale
|
||||
Rating *int `json:"rating"`
|
||||
Organized bool `json:"organized"`
|
||||
OCounter int `json:"o_counter"`
|
||||
StudioID *int `json:"studio_id"`
|
||||
URL string `json:"url"`
|
||||
Date *Date `json:"date"`
|
||||
Rating *int `json:"rating"`
|
||||
Organized bool `json:"organized"`
|
||||
OCounter int `json:"o_counter"`
|
||||
StudioID *int `json:"studio_id"`
|
||||
URLs RelatedStrings `json:"urls"`
|
||||
Date *Date `json:"date"`
|
||||
|
||||
// transient - not persisted
|
||||
Files RelatedFiles
|
||||
@@ -48,7 +48,7 @@ type ImagePartial struct {
|
||||
Title OptionalString
|
||||
// Rating expressed in 1-100 scale
|
||||
Rating OptionalInt
|
||||
URL OptionalString
|
||||
URLs *UpdateStrings
|
||||
Date OptionalDate
|
||||
Organized OptionalBool
|
||||
OCounter OptionalInt
|
||||
@@ -69,6 +69,12 @@ func NewImagePartial() ImagePartial {
|
||||
}
|
||||
}
|
||||
|
||||
func (i *Image) LoadURLs(ctx context.Context, l URLLoader) error {
|
||||
return i.URLs.load(func() ([]string, error) {
|
||||
return l.GetURLs(ctx, i.ID)
|
||||
})
|
||||
}
|
||||
|
||||
func (i *Image) LoadFiles(ctx context.Context, l FileLoader) error {
|
||||
return i.Files.load(func() ([]File, error) {
|
||||
return l.GetFiles(ctx, i.ID)
|
||||
|
||||
Reference in New Issue
Block a user