From 5a51d4a74b5a656a1b11c4636956abe23c975d17 Mon Sep 17 00:00:00 2001 From: Saiyed Shizain Date: Tue, 1 Sep 2026 23:16:15 +0530 Subject: feat(gallery): add date range to gallery queries --- internal/gallery/query_photos_test.go | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'internal/gallery/query_photos_test.go') diff --git a/internal/gallery/query_photos_test.go b/internal/gallery/query_photos_test.go index f38c237..e5ef560 100644 --- a/internal/gallery/query_photos_test.go +++ b/internal/gallery/query_photos_test.go @@ -409,3 +409,53 @@ func TestQueryPhotosFilterSearchSortThenPaginate(t *testing.T) { assertIDs(t, got, "5") } + +func TestQueryPhotosIgnoresDateRangesForNow(t *testing.T) { + photos := []Photo{ + { + ID: "old", + Metadata: metadata.Metadata{ + DateTaken: time.Date( + 2024, + 1, + 1, + 0, + 0, + 0, + 0, + time.UTC, + ), + }, + }, + { + ID: "new", + Metadata: metadata.Metadata{ + DateTaken: time.Date( + 2025, + 1, + 1, + 0, + 0, + 0, + 0, + time.UTC, + ), + }, + }, + } + + got := QueryPhotos(photos, Query{ + From: time.Date( + 2025, + 1, + 1, + 0, + 0, + 0, + 0, + time.UTC, + ), + }) + + assertIDs(t, got, "old", "new") +} -- cgit v1.2.3