2021-09-18 15:32:39 +02:00
|
|
|
package search
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/photoprism/photoprism/internal/entity"
|
|
|
|
"github.com/photoprism/photoprism/internal/form"
|
|
|
|
)
|
|
|
|
|
|
|
|
// AlbumPhotos returns up to count photos from an album.
|
2022-01-03 12:51:59 +01:00
|
|
|
func AlbumPhotos(a entity.Album, count int, shared bool) (results PhotoResults, err error) {
|
|
|
|
frm := form.SearchPhotos{
|
2021-09-18 15:32:39 +02:00
|
|
|
Album: a.AlbumUID,
|
|
|
|
Filter: a.AlbumFilter,
|
|
|
|
Count: count,
|
|
|
|
Offset: 0,
|
2022-01-03 12:51:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if shared {
|
|
|
|
frm.Public = true
|
|
|
|
frm.Private = false
|
|
|
|
frm.Hidden = false
|
|
|
|
frm.Archived = false
|
|
|
|
frm.Review = false
|
|
|
|
}
|
|
|
|
|
|
|
|
results, _, err = Photos(frm)
|
2021-09-18 15:32:39 +02:00
|
|
|
|
|
|
|
return results, err
|
|
|
|
}
|