photoprism/internal/entity/description_fixtures.go
Michael Mayer 8ccaaff4e5 Backend: Update label photo count and refactor entity fixtures
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-10 19:43:49 +02:00

35 lines
750 B
Go

package entity
type DescriptionMap map[string]Description
func (m DescriptionMap) Get(name string, photoId uint) Description {
if result, ok := m[name]; ok {
result.PhotoID = photoId
return result
}
return Description{PhotoID: photoId}
}
func (m DescriptionMap) Pointer(name string, photoId uint) *Description {
if result, ok := m[name]; ok {
result.PhotoID = photoId
return &result
}
return &Description{PhotoID: photoId}
}
var DescriptionFixtures = DescriptionMap{
"lake": {
PhotoID: 1000000,
PhotoDescription: "photo description",
PhotoKeywords: "nature, frog",
PhotoNotes: "notes",
PhotoSubject: "Lake",
PhotoArtist: "Hans",
PhotoCopyright: "copy",
PhotoLicense: "MIT",
},
}