Add pb message for dupe filter

This commit is contained in:
RumovZ 2021-01-13 11:57:41 +01:00 committed by Damien Elmes
parent d9bb20ac24
commit 6d9cfb85ab
2 changed files with 9 additions and 0 deletions

View File

@ -775,12 +775,17 @@ message FilterToSearchIn {
NO_FLAG = 15; NO_FLAG = 15;
ANY_FLAG = 16; ANY_FLAG = 16;
} }
message DupeIn {
NoteTypeID mid = 1;
string text = 2;
}
oneof filter { oneof filter {
NamedFilter name = 1; NamedFilter name = 1;
string tag = 2; string tag = 2;
string deck = 3; string deck = 3;
string note = 4; string note = 4;
uint32 template = 5; uint32 template = 5;
DupeIn dupe = 6;
} }
} }

View File

@ -327,6 +327,10 @@ impl From<pb::FilterToSearchIn> for Node<'_> {
Filter::Template(u) => { Filter::Template(u) => {
Node::Search(SearchNode::CardTemplate(TemplateKind::Ordinal(u as u16))) Node::Search(SearchNode::CardTemplate(TemplateKind::Ordinal(u as u16)))
} }
Filter::Dupe(dupe) => Node::Search(SearchNode::Duplicates {
note_type_id: dupe.mid.unwrap_or(pb::NoteTypeId { ntid: 0 }).into(),
text: dupe.text.into(),
}),
} }
} }
} }