From 256fbb49ba2391f8813286cc34af74608663f4f3 Mon Sep 17 00:00:00 2001 From: Frederick Robinson Date: Wed, 10 Jan 2024 09:37:18 -0700 Subject: [PATCH] docs(filters): explain GetDownloadsByFilterId (#1345) add comment about GetDownloadsByFilterId --- internal/database/filter.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/database/filter.go b/internal/database/filter.go index 230273e..d5f0d43 100644 --- a/internal/database/filter.go +++ b/internal/database/filter.go @@ -1426,6 +1426,13 @@ func (r *FilterRepo) Delete(ctx context.Context, filterID int) error { return nil } +// GetDownloadsByFilterId looks up how many `PENDING` or `PUSH_APPROVED` +// releases there have been for the given filter in the current time window +// starting at the start of the unit (since the beginning of the most recent +// hour/day/week). +// +// See also +// https://github.com/autobrr/autobrr/pull/1285#pullrequestreview-1795913581 func (r *FilterRepo) GetDownloadsByFilterId(ctx context.Context, filterID int) (*domain.FilterDownloads, error) { if r.db.Driver == "sqlite" { return r.downloadsByFilterSqlite(ctx, filterID)