mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Rename filters added_in etc. to added_in_days
This commit is contained in:
parent
f04228990d
commit
1fb6024454
4 changed files with 18 additions and 21 deletions
|
@ -501,9 +501,9 @@ class Collection:
|
||||||
note: Optional[str] = None,
|
note: Optional[str] = None,
|
||||||
template: Optional[int] = None,
|
template: Optional[int] = None,
|
||||||
dupe: Optional[Tuple[int, str]] = None,
|
dupe: Optional[Tuple[int, str]] = None,
|
||||||
forgot_in: Optional[int] = None,
|
forgot_in_days: Optional[int] = None,
|
||||||
added_in: Optional[int] = None,
|
added_in_days: Optional[int] = None,
|
||||||
due_in: Optional[int] = None,
|
due_in_days: Optional[int] = None,
|
||||||
nids: Optional[List[int]] = None,
|
nids: Optional[List[int]] = None,
|
||||||
field_name: Optional[str] = None,
|
field_name: Optional[str] = None,
|
||||||
) -> str:
|
) -> str:
|
||||||
|
@ -525,12 +525,12 @@ class Collection:
|
||||||
if dupe:
|
if dupe:
|
||||||
dupe_in = DupeIn(mid=BackendNoteTypeID(ntid=dupe[0]), text=dupe[1])
|
dupe_in = DupeIn(mid=BackendNoteTypeID(ntid=dupe[0]), text=dupe[1])
|
||||||
append_filter(FilterToSearchIn(dupe=dupe_in))
|
append_filter(FilterToSearchIn(dupe=dupe_in))
|
||||||
if forgot_in:
|
if forgot_in_days:
|
||||||
append_filter(FilterToSearchIn(forgot_in=forgot_in))
|
append_filter(FilterToSearchIn(forgot_in_days=forgot_in_days))
|
||||||
if added_in:
|
if added_in_days:
|
||||||
append_filter(FilterToSearchIn(added_in=added_in))
|
append_filter(FilterToSearchIn(added_in_days=added_in_days))
|
||||||
if due_in:
|
if due_in_days:
|
||||||
append_filter(FilterToSearchIn(due_in=due_in))
|
append_filter(FilterToSearchIn(due_in_days=due_in_days))
|
||||||
if nids:
|
if nids:
|
||||||
append_filter(FilterToSearchIn(nids=NoteIDs(nids=nids)))
|
append_filter(FilterToSearchIn(nids=NoteIDs(nids=nids)))
|
||||||
if field_name:
|
if field_name:
|
||||||
|
|
|
@ -160,15 +160,15 @@ class CustomStudy(QDialog):
|
||||||
dyn = self.mw.col.decks.get(did)
|
dyn = self.mw.col.decks.get(did)
|
||||||
# and then set various options
|
# and then set various options
|
||||||
if i == RADIO_FORGOT:
|
if i == RADIO_FORGOT:
|
||||||
search = self.mw.col.search_string(forgot_in=spin)
|
search = self.mw.col.search_string(forgot_in_days=spin)
|
||||||
dyn["terms"][0] = [search, DYN_MAX_SIZE, DYN_RANDOM]
|
dyn["terms"][0] = [search, DYN_MAX_SIZE, DYN_RANDOM]
|
||||||
dyn["resched"] = False
|
dyn["resched"] = False
|
||||||
elif i == RADIO_AHEAD:
|
elif i == RADIO_AHEAD:
|
||||||
search = self.mw.col.search_string(due_in=spin)
|
search = self.mw.col.search_string(due_in_days=spin)
|
||||||
dyn["terms"][0] = [search, DYN_MAX_SIZE, DYN_DUE]
|
dyn["terms"][0] = [search, DYN_MAX_SIZE, DYN_DUE]
|
||||||
dyn["resched"] = True
|
dyn["resched"] = True
|
||||||
elif i == RADIO_PREVIEW:
|
elif i == RADIO_PREVIEW:
|
||||||
search = self.mw.col.search_string(name=NamedFilter.NEW, added_in=spin)
|
search = self.mw.col.search_string(name=NamedFilter.NEW, added_in_days=spin)
|
||||||
dyn["terms"][0] = [search, DYN_MAX_SIZE, DYN_OLDEST]
|
dyn["terms"][0] = [search, DYN_MAX_SIZE, DYN_OLDEST]
|
||||||
dyn["resched"] = False
|
dyn["resched"] = False
|
||||||
elif i == RADIO_CRAM:
|
elif i == RADIO_CRAM:
|
||||||
|
|
|
@ -795,12 +795,9 @@ message FilterToSearchIn {
|
||||||
string note = 4;
|
string note = 4;
|
||||||
uint32 template = 5;
|
uint32 template = 5;
|
||||||
DupeIn dupe = 6;
|
DupeIn dupe = 6;
|
||||||
// rated Again in the last x days
|
uint32 forgot_in_days = 7;
|
||||||
uint32 forgot_in = 7;
|
uint32 added_in_days = 8;
|
||||||
// added in the last x days
|
int32 due_in_days = 9;
|
||||||
uint32 added_in = 8;
|
|
||||||
// will be due in the next x days
|
|
||||||
int32 due_in = 9;
|
|
||||||
NoteIDs nids = 10;
|
NoteIDs nids = 10;
|
||||||
string field_name = 11;
|
string field_name = 11;
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,12 +341,12 @@ impl From<pb::FilterToSearchIn> for Node<'_> {
|
||||||
note_type_id: dupe.mid.unwrap_or(pb::NoteTypeId { ntid: 0 }).into(),
|
note_type_id: dupe.mid.unwrap_or(pb::NoteTypeId { ntid: 0 }).into(),
|
||||||
text: dupe.text.into(),
|
text: dupe.text.into(),
|
||||||
}),
|
}),
|
||||||
Filter::ForgotIn(u) => Node::Search(SearchNode::Rated {
|
Filter::ForgotInDays(u) => Node::Search(SearchNode::Rated {
|
||||||
days: u,
|
days: u,
|
||||||
ease: EaseKind::AnswerButton(1),
|
ease: EaseKind::AnswerButton(1),
|
||||||
}),
|
}),
|
||||||
Filter::AddedIn(u) => Node::Search(SearchNode::AddedInDays(u)),
|
Filter::AddedInDays(u) => Node::Search(SearchNode::AddedInDays(u)),
|
||||||
Filter::DueIn(i) => Node::Search(SearchNode::Property {
|
Filter::DueInDays(i) => Node::Search(SearchNode::Property {
|
||||||
operator: "<=".to_string(),
|
operator: "<=".to_string(),
|
||||||
kind: PropertyKind::Due(i),
|
kind: PropertyKind::Due(i),
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in a new issue