mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
Add forgot, due and added filters on backend
This commit is contained in:
parent
687e0b070b
commit
b15bb4289e
2 changed files with 16 additions and 1 deletions
|
@ -791,6 +791,12 @@ message FilterToSearchIn {
|
|||
string note = 4;
|
||||
uint32 template = 5;
|
||||
DupeIn dupe = 6;
|
||||
// rated Again in the last x days
|
||||
uint32 forgot_in = 7;
|
||||
// added in the last x days
|
||||
uint32 added_in = 8;
|
||||
// will be due in the next x days
|
||||
int32 due_in = 9;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ use crate::{
|
|||
sched::timespan::{answer_button_time, time_span},
|
||||
search::{
|
||||
concatenate_searches, negate_search, normalize_search, replace_search_term, write_nodes,
|
||||
BoolSeparator, EaseKind, Node, SearchNode, SortMode, StateKind, TemplateKind,
|
||||
BoolSeparator, EaseKind, Node, PropertyKind, SearchNode, SortMode, StateKind, TemplateKind,
|
||||
},
|
||||
stats::studied_today,
|
||||
sync::{
|
||||
|
@ -331,6 +331,15 @@ impl From<pb::FilterToSearchIn> for Node<'_> {
|
|||
note_type_id: dupe.mid.unwrap_or(pb::NoteTypeId { ntid: 0 }).into(),
|
||||
text: dupe.text.into(),
|
||||
}),
|
||||
Filter::ForgotIn(u) => Node::Search(SearchNode::Rated {
|
||||
days: u,
|
||||
ease: EaseKind::AnswerButton(1),
|
||||
}),
|
||||
Filter::AddedIn(u) => Node::Search(SearchNode::AddedInDays(u)),
|
||||
Filter::DueIn(i) => Node::Search(SearchNode::Property {
|
||||
operator: "<=".to_string(),
|
||||
kind: PropertyKind::Due(i),
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue