From 7578221f92f9a3c3cc1ac71735e7ddb170dde939 Mon Sep 17 00:00:00 2001 From: RanXom Date: Wed, 22 Jul 2026 18:04:22 +0530 Subject: feat(gallery): add extension filter to queries --- internal/gallery/query.go | 2 ++ internal/gallery/query_photos_test.go | 10 ++++++++++ 2 files changed, 12 insertions(+) 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") +} -- cgit v1.2.3