diff options
| author | RanXom <saiyedshizain@gmail.com> | 2026-07-17 22:05:17 +0530 |
|---|---|---|
| committer | RanXom <saiyedshizain@gmail.com> | 2026-07-17 22:05:17 +0530 |
| commit | 41ad7da084544b3b8eea5b009cc3cab652988b8d (patch) | |
| tree | 723b9f74b7d04a0a969ffb8ec72db30ecb23f0ea /internal/gallery/query.go | |
| parent | e6a510a370d8048681c2c4e6f444dd2b0045041d (diff) | |
| download | galleryd-41ad7da084544b3b8eea5b009cc3cab652988b8d.tar.xz galleryd-41ad7da084544b3b8eea5b009cc3cab652988b8d.zip | |
feat(gallery): add sorting options to queries
Diffstat (limited to 'internal/gallery/query.go')
| -rw-r--r-- | internal/gallery/query.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/gallery/query.go b/internal/gallery/query.go index fd11762..f528906 100644 --- a/internal/gallery/query.go +++ b/internal/gallery/query.go @@ -1,9 +1,27 @@ package gallery +type SortField string + +const ( + SortByDateTime SortField = "dateTaken" + SortByPath SortField = "path" +) + +// SortOrder identifies the sort direction +type SortOrder string + +const ( + SortAsc SortOrder = "asc" + SortDesc SortOrder = "desc" +) + // Query describes how photos should be selected. // // The zero value returns the entire gallery. type Query struct { Limit int Offset int + + Sort SortField + Order SortOrder } |