Multiple image URLs (#4000)

* Backend changes - ported from scene impl
* Front end changes
* Refactor URL mutation code
This commit is contained in:
WithoutPants
2023-09-12 13:31:53 +10:00
committed by GitHub
parent 9f4d0af886
commit a25286bdcb
29 changed files with 457 additions and 173 deletions

View File

@@ -14,7 +14,7 @@ import (
func ToBasicJSON(image *models.Image) *jsonschema.Image {
newImageJSON := jsonschema.Image{
Title: image.Title,
URL: image.URL,
URLs: image.URLs.List(),
CreatedAt: json.JSONTime{Time: image.CreatedAt},
UpdatedAt: json.JSONTime{Time: image.UpdatedAt},
}
@@ -37,19 +37,6 @@ func ToBasicJSON(image *models.Image) *jsonschema.Image {
return &newImageJSON
}
// func getImageFileJSON(image *models.Image) *jsonschema.ImageFile {
// ret := &jsonschema.ImageFile{}
// f := image.PrimaryFile()
// ret.ModTime = json.JSONTime{Time: f.ModTime}
// ret.Size = f.Size
// ret.Width = f.Width
// ret.Height = f.Height
// return ret
// }
// GetStudioName returns the name of the provided image's studio. It returns an
// empty string if there is no studio assigned to the image.
func GetStudioName(ctx context.Context, reader models.StudioGetter, image *models.Image) (string, error) {