photoprism/internal/entity/description_fixtures.go

45 lines
1 KiB
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",
},
2020-05-12 13:52:09 +02:00
"blacklist": {
PhotoID: 1000001,
PhotoDescription: "photo description blacklist",
PhotoKeywords: "screenshot, info",
PhotoNotes: "notes",
PhotoSubject: "Blacklist",
PhotoArtist: "Hans",
PhotoCopyright: "copy",
PhotoLicense: "MIT",
},
2020-05-08 14:18:11 +02:00
}