[Feature] Images new fields : URL & Date (#3015)

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
HijackHornet
2022-12-20 01:13:41 +01:00
committed by GitHub
parent cc4b0f7b11
commit 0b4b100ecc
23 changed files with 191 additions and 15 deletions

View File

@@ -15,6 +15,7 @@ import (
func ToBasicJSON(image *models.Image) *jsonschema.Image {
newImageJSON := jsonschema.Image{
Title: image.Title,
URL: image.URL,
CreatedAt: json.JSONTime{Time: image.CreatedAt},
UpdatedAt: json.JSONTime{Time: image.UpdatedAt},
}
@@ -23,6 +24,10 @@ func ToBasicJSON(image *models.Image) *jsonschema.Image {
newImageJSON.Rating = *image.Rating
}
if image.Date != nil {
newImageJSON.Date = image.Date.String()
}
newImageJSON.Organized = image.Organized
newImageJSON.OCounter = image.OCounter