mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Fix reparenting message with tags
This commit is contained in:
parent
52347819dd
commit
199958c1c5
1 changed files with 10 additions and 1 deletions
|
@ -40,14 +40,23 @@ impl Collection {
|
|||
) -> Result<usize> {
|
||||
let usn = self.usn()?;
|
||||
let mut matcher = TagMatcher::new(&join_tags(tags_to_reparent))?;
|
||||
|
||||
let old_to_new_names = old_to_new_names(tags_to_reparent, new_parent);
|
||||
if old_to_new_names.is_empty() {
|
||||
return Ok(0);
|
||||
}
|
||||
|
||||
let matched_notes = self
|
||||
.storage
|
||||
.get_note_tags_by_predicate(|tags| matcher.is_match(tags))?;
|
||||
let match_count = matched_notes.len();
|
||||
|
||||
let mut match_count = 0;
|
||||
for name in old_to_new_names.keys() {
|
||||
if &UniCase::new(old_to_new_names.get(name).unwrap()) != name {
|
||||
match_count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if match_count == 0 {
|
||||
// no matches; exit early so we don't clobber the empty tag entries
|
||||
return Ok(0);
|
||||
|
|
Loading…
Reference in a new issue