mirror of
https://github.com/ankitects/anki.git
synced 2025-11-12 07:37:11 -05:00
Fix invalid preset search matching cards in filtered decks
https://forums.ankiweb.net/t/anki-24-10-release-candidate/51191/64
This commit is contained in:
parent
487b38b06c
commit
1f96489755
1 changed files with 13 additions and 0 deletions
|
|
@ -842,8 +842,14 @@ impl SqlWriter<'_> {
|
||||||
self.col.get_config_bool(BoolKey::IgnoreAccentsInSearch),
|
self.col.get_config_bool(BoolKey::IgnoreAccentsInSearch),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_deck_preset(&mut self, name: &str) -> Result<()> {
|
fn write_deck_preset(&mut self, name: &str) -> Result<()> {
|
||||||
let dcid = self.col.storage.get_deck_config_id_by_name(name)?;
|
let dcid = self.col.storage.get_deck_config_id_by_name(name)?;
|
||||||
|
if dcid.is_none() {
|
||||||
|
write!(self.sql, "false").unwrap();
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
|
||||||
let mut str_ids = String::new();
|
let mut str_ids = String::new();
|
||||||
let deck_ids = self
|
let deck_ids = self
|
||||||
.col
|
.col
|
||||||
|
|
@ -1284,6 +1290,13 @@ c.odue != 0 then c.odue else c.due end) != {days}) or (c.queue in (1,4) and
|
||||||
&s(ctx, "has-cd:r").0,
|
&s(ctx, "has-cd:r").0,
|
||||||
"(extract_custom_data(c.data, 'r') is not null)"
|
"(extract_custom_data(c.data, 'r') is not null)"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// preset search
|
||||||
|
assert_eq!(
|
||||||
|
&s(ctx, "preset:default").0,
|
||||||
|
"((c.did in (1) or c.odid in (1)))"
|
||||||
|
);
|
||||||
|
assert_eq!(&s(ctx, "preset:typo").0, "(false)");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue