From e7cf1fc44ded2be04f3ff144c29bfc73bed809c8 Mon Sep 17 00:00:00 2001 From: Saiyed Shizain Date: Tue, 1 Sep 2026 23:22:57 +0530 Subject: Revert "feat(gallery): add date range to gallery queries" This reverts commit 5a51d4a74b5a656a1b11c4636956abe23c975d17. --- internal/gallery/query.go | 5 ---- internal/gallery/query_photos_test.go | 50 ----------------------------------- 2 files changed, 55 deletions(-) diff --git a/internal/gallery/query.go b/internal/gallery/query.go index 355aa2e..346c25f 100644 --- a/internal/gallery/query.go +++ b/internal/gallery/query.go @@ -1,7 +1,5 @@ package gallery -import "time" - type SortField string const ( @@ -29,7 +27,4 @@ type Query struct { Extension string Search string - - From time.Time - To time.Time } diff --git a/internal/gallery/query_photos_test.go b/internal/gallery/query_photos_test.go index e5ef560..f38c237 100644 --- a/internal/gallery/query_photos_test.go +++ b/internal/gallery/query_photos_test.go @@ -409,53 +409,3 @@ 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