diff options
| author | RanXom <saiyedshizain@gmail.com> | 2026-07-22 18:04:22 +0530 |
|---|---|---|
| committer | RanXom <saiyedshizain@gmail.com> | 2026-07-22 18:04:22 +0530 |
| commit | 7578221f92f9a3c3cc1ac71735e7ddb170dde939 (patch) | |
| tree | a6044628f75cb424a93fc142a7ed3df02f659dbc /internal/gallery | |
| parent | 9b541ca2d0a639eebd9610fcd6385e841da68e0a (diff) | |
| download | galleryd-7578221f92f9a3c3cc1ac71735e7ddb170dde939.tar.xz galleryd-7578221f92f9a3c3cc1ac71735e7ddb170dde939.zip | |
feat(gallery): add extension filter to queries
Diffstat (limited to 'internal/gallery')
| -rw-r--r-- | internal/gallery/query.go | 2 | ||||
| -rw-r--r-- | internal/gallery/query_photos_test.go | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/internal/gallery/query.go b/internal/gallery/query.go index e2003d5..b66f99a 100644 --- a/internal/gallery/query.go +++ b/internal/gallery/query.go @@ -24,4 +24,6 @@ type Query struct { Sort SortField Order SortOrder + + Extension string } diff --git a/internal/gallery/query_photos_test.go b/internal/gallery/query_photos_test.go index c9bb986..05dab67 100644 --- a/internal/gallery/query_photos_test.go +++ b/internal/gallery/query_photos_test.go @@ -250,3 +250,13 @@ func TestQueryPhotosSortByDateDescending(t *testing.T) { assertIDs(t, got, "new", "mid", "old") } + +func TestQueryPhotosIgnoresExtensionFilteringForNow(t *testing.T) { + photos := makePhotos(3) + + got := QueryPhotos(photos, Query{ + Extension: "jpg", + }) + + assertIDs(t, got, "0", "1", "2") +} |