docs(filters): explain GetDownloadsByFilterId (#1345)

add comment about GetDownloadsByFilterId
This commit is contained in:
Frederick Robinson 2024-01-10 09:37:18 -07:00 committed by GitHub
parent f464e91e18
commit 256fbb49ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1426,6 +1426,13 @@ func (r *FilterRepo) Delete(ctx context.Context, filterID int) error {
return nil 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) { func (r *FilterRepo) GetDownloadsByFilterId(ctx context.Context, filterID int) (*domain.FilterDownloads, error) {
if r.db.Driver == "sqlite" { if r.db.Driver == "sqlite" {
return r.downloadsByFilterSqlite(ctx, filterID) return r.downloadsByFilterSqlite(ctx, filterID)