mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Refactor search to separate between a base query and user query
The `findBase` is adding only strictly required conditions. Everything else comes from the user.
This commit is contained in:
@ -72,13 +72,16 @@ object NotifyDueItemsTask {
|
||||
q =
|
||||
Query
|
||||
.empty(ctx.args.account)
|
||||
.copy(
|
||||
states = ItemState.validStates.toList,
|
||||
tagsInclude = ctx.args.tagsInclude,
|
||||
tagsExclude = ctx.args.tagsExclude,
|
||||
dueDateFrom = ctx.args.daysBack.map(back => now - Duration.days(back.toLong)),
|
||||
dueDateTo = Some(now + Duration.days(ctx.args.remindDays.toLong)),
|
||||
orderAsc = Some(_.dueDate)
|
||||
.withOrder(orderAsc = _.dueDate)
|
||||
.withCond(
|
||||
_.copy(
|
||||
states = ItemState.validStates.toList,
|
||||
tagsInclude = ctx.args.tagsInclude,
|
||||
tagsExclude = ctx.args.tagsExclude,
|
||||
dueDateFrom =
|
||||
ctx.args.daysBack.map(back => now - Duration.days(back.toLong)),
|
||||
dueDateTo = Some(now + Duration.days(ctx.args.remindDays.toLong))
|
||||
)
|
||||
)
|
||||
res <-
|
||||
ctx.store
|
||||
|
Reference in New Issue
Block a user