Add Details, Studio Code, and Photographer to Images (#4217)

* Add Details, Code, and Photographer to Images
* Add date and details to image card
---------
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
bob123491234
2023-11-27 22:45:07 -06:00
committed by GitHub
parent d1018b4c5d
commit 413311711f
19 changed files with 244 additions and 81 deletions
+8 -5
View File
@@ -3,11 +3,14 @@ package models
import "context"
type ImageFilterType struct {
And *ImageFilterType `json:"AND"`
Or *ImageFilterType `json:"OR"`
Not *ImageFilterType `json:"NOT"`
ID *IntCriterionInput `json:"id"`
Title *StringCriterionInput `json:"title"`
And *ImageFilterType `json:"AND"`
Or *ImageFilterType `json:"OR"`
Not *ImageFilterType `json:"NOT"`
ID *IntCriterionInput `json:"id"`
Title *StringCriterionInput `json:"title"`
Code *StringCriterionInput `json:"code"`
Details *StringCriterionInput `json:"details"`
Photographer *StringCriterionInput `json:"photographer"`
// Filter by file checksum
Checksum *StringCriterionInput `json:"checksum"`
// Filter by path
+13 -10
View File
@@ -11,22 +11,25 @@ import (
type Image struct {
Title string `json:"title,omitempty"`
Code string `json:"code,omitempty"`
Studio string `json:"studio,omitempty"`
Rating int `json:"rating,omitempty"`
// deprecated - for import only
URL string `json:"url,omitempty"`
URLs []string `json:"urls,omitempty"`
Date string `json:"date,omitempty"`
Organized bool `json:"organized,omitempty"`
OCounter int `json:"o_counter,omitempty"`
Galleries []GalleryRef `json:"galleries,omitempty"`
Performers []string `json:"performers,omitempty"`
Tags []string `json:"tags,omitempty"`
Files []string `json:"files,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
URLs []string `json:"urls,omitempty"`
Date string `json:"date,omitempty"`
Details string `json:"details,omitempty"`
Photographer string `json:"photographer,omitempty"`
Organized bool `json:"organized,omitempty"`
OCounter int `json:"o_counter,omitempty"`
Galleries []GalleryRef `json:"galleries,omitempty"`
Performers []string `json:"performers,omitempty"`
Tags []string `json:"tags,omitempty"`
Files []string `json:"files,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
}
func (s Image) Filename(basename string, hash string) string {
+15 -9
View File
@@ -11,7 +11,10 @@ import (
type Image struct {
ID int `json:"id"`
Title string `json:"title"`
Title string `json:"title"`
Code string `json:"code"`
Details string `json:"details"`
Photographer string `json:"photographer"`
// Rating expressed in 1-100 scale
Rating *int `json:"rating"`
Organized bool `json:"organized"`
@@ -46,15 +49,18 @@ func NewImage() Image {
type ImagePartial struct {
Title OptionalString
Code OptionalString
// Rating expressed in 1-100 scale
Rating OptionalInt
URLs *UpdateStrings
Date OptionalDate
Organized OptionalBool
OCounter OptionalInt
StudioID OptionalInt
CreatedAt OptionalTime
UpdatedAt OptionalTime
Rating OptionalInt
URLs *UpdateStrings
Date OptionalDate
Details OptionalString
Photographer OptionalString
Organized OptionalBool
OCounter OptionalInt
StudioID OptionalInt
CreatedAt OptionalTime
UpdatedAt OptionalTime
GalleryIDs *UpdateIDs
TagIDs *UpdateIDs