diff --git a/plan/storage/sqlite/task.go b/plan/storage/sqlite/task.go index 67453ca..25ded29 100644 --- a/plan/storage/sqlite/task.go +++ b/plan/storage/sqlite/task.go @@ -70,7 +70,7 @@ FROM tasks`) if err != nil { return nil, fmt.Errorf("%w: %v", ErrSqliteFailure, err) } - result := make([]item.Task, 0) + tasks := make([]item.Task, 0) defer rows.Close() for rows.Next() { var tsk item.Task @@ -87,10 +87,12 @@ FROM tasks`) tsk.Duration = dur tsk.Recurrer = item.NewRecurrer(recurStr) - result = append(result, tsk) + if storage.Match(tsk, params) { + tasks = append(tasks, tsk) + } } - return result, nil + return tasks, nil } func (s *SqliteTask) Delete(id string) error {