mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
target_already_exists→card_ordinal_already_exists
This commit is contained in:
parent
274afc7b3f
commit
f03df4ac3a
1 changed files with 2 additions and 2 deletions
|
@ -86,7 +86,7 @@ impl Context<'_> {
|
||||||
impl CardContext<'_> {
|
impl CardContext<'_> {
|
||||||
fn import_cards(&mut self, mut cards: Vec<Card>) -> Result<()> {
|
fn import_cards(&mut self, mut cards: Vec<Card>) -> Result<()> {
|
||||||
for card in &mut cards {
|
for card in &mut cards {
|
||||||
if self.map_to_imported_note(card) && !self.target_already_exists(card) {
|
if self.map_to_imported_note(card) && !self.card_ordinal_already_exists(card) {
|
||||||
self.add_card(card)?;
|
self.add_card(card)?;
|
||||||
}
|
}
|
||||||
// TODO: could update existing card
|
// TODO: could update existing card
|
||||||
|
@ -114,7 +114,7 @@ impl CardContext<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn target_already_exists(&self, card: &Card) -> bool {
|
fn card_ordinal_already_exists(&self, card: &Card) -> bool {
|
||||||
self.existing_cards
|
self.existing_cards
|
||||||
.contains(&(card.note_id, card.template_idx))
|
.contains(&(card.note_id, card.template_idx))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue