diff --git a/rslib/backend.proto b/rslib/backend.proto index 434241e1a..2a5e213b3 100644 --- a/rslib/backend.proto +++ b/rslib/backend.proto @@ -775,12 +775,17 @@ message FilterToSearchIn { NO_FLAG = 15; ANY_FLAG = 16; } + message DupeIn { + NoteTypeID mid = 1; + string text = 2; + } oneof filter { NamedFilter name = 1; string tag = 2; string deck = 3; string note = 4; uint32 template = 5; + DupeIn dupe = 6; } } diff --git a/rslib/src/backend/mod.rs b/rslib/src/backend/mod.rs index ea8a90a26..10c7c5e00 100644 --- a/rslib/src/backend/mod.rs +++ b/rslib/src/backend/mod.rs @@ -327,6 +327,10 @@ impl From for Node<'_> { Filter::Template(u) => { 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(), + }), } } }