mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-11 16:24:11 +01:00
27 lines
469 B
Go
27 lines
469 B
Go
package entity
|
|
|
|
// Photos represents a list of photos.
|
|
type Photos []Photo
|
|
|
|
// Photos returns the result as a slice of Photo.
|
|
func (m Photos) Photos() []PhotoInterface {
|
|
result := make([]PhotoInterface, len(m))
|
|
|
|
for i := range m {
|
|
result[i] = &m[i]
|
|
}
|
|
|
|
return result
|
|
}
|
|
|
|
// UIDs returns the photo UIDs as string slice.
|
|
func (m Photos) UIDs() []string {
|
|
result := make([]string, len(m))
|
|
|
|
for i, photo := range m {
|
|
result[i] = photo.GetUID()
|
|
}
|
|
|
|
return result
|
|
}
|