aboutsummaryrefslogtreecommitdiff
path: root/internal/gallery/query_photos.go
diff options
context:
space:
mode:
authorRanXom <saiyedshizain@gmail.com>2026-07-18 22:40:52 +0530
committerRanXom <saiyedshizain@gmail.com>2026-07-18 22:40:52 +0530
commiteb6a8c0306c44d5317c8d321ae24537bac9434ed (patch)
tree4fa8310e498441e93efd1b23584bee55cef2af78 /internal/gallery/query_photos.go
parent8983d196786b86045920c0ee0e03711fbf62dfe8 (diff)
downloadgalleryd-eb6a8c0306c44d5317c8d321ae24537bac9434ed.tar.xz
galleryd-eb6a8c0306c44d5317c8d321ae24537bac9434ed.zip
feat(gallery): support sorted photo queries
Diffstat (limited to 'internal/gallery/query_photos.go')
-rw-r--r--internal/gallery/query_photos.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/gallery/query_photos.go b/internal/gallery/query_photos.go
index 12fa877..e024090 100644
--- a/internal/gallery/query_photos.go
+++ b/internal/gallery/query_photos.go
@@ -4,6 +4,12 @@ func QueryPhotos(
photos []Photo,
query Query,
) []Photo {
+ if query.Sort != "" {
+ photos = append([]Photo(nil), photos...)
+
+ sortQueryPhotos(photos, query)
+ }
+
if query.Offset >= len(photos) {
return []Photo{}
}