photoprism/internal/entity/description_fixtures.go

35 lines
755 B
Go
Raw Normal View History

2020-05-08 14:18:11 +02:00
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{
2020-05-08 14:18:11 +02:00
"lake": {
PhotoID: 1000000,
2020-05-12 11:51:28 +02:00
PhotoDescription: "photo description lake",
2020-05-08 14:18:11 +02:00
PhotoKeywords: "nature, frog",
PhotoNotes: "notes",
PhotoSubject: "Lake",
PhotoArtist: "Hans",
PhotoCopyright: "copy",
PhotoLicense: "MIT",
},
}