mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
Export deck limits when exporting with scheduling
This commit is contained in:
parent
138a03b6b0
commit
cdc781e17f
3 changed files with 7 additions and 2 deletions
|
@ -270,6 +270,7 @@ class AnkiExporter(Exporter):
|
||||||
# scheduling not included, so reset deck settings to default
|
# scheduling not included, so reset deck settings to default
|
||||||
d = dict(d)
|
d = dict(d)
|
||||||
d["conf"] = 1
|
d["conf"] = 1
|
||||||
|
d["reviewLimit"] = d["newLimit"] = None
|
||||||
self.dst.decks.update(d)
|
self.dst.decks.update(d)
|
||||||
# copy used deck confs
|
# copy used deck confs
|
||||||
for dc in self.src.decks.all_config():
|
for dc in self.src.decks.all_config():
|
||||||
|
|
|
@ -77,7 +77,7 @@ impl ExchangeData {
|
||||||
|
|
||||||
fn remove_scheduling_information(&mut self, col: &Collection) {
|
fn remove_scheduling_information(&mut self, col: &Collection) {
|
||||||
self.remove_system_tags();
|
self.remove_system_tags();
|
||||||
self.reset_deck_config_ids();
|
self.reset_deck_config_ids_and_limits();
|
||||||
self.reset_cards(col);
|
self.reset_cards(col);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,10 +91,12 @@ impl ExchangeData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn reset_deck_config_ids(&mut self) {
|
fn reset_deck_config_ids_and_limits(&mut self) {
|
||||||
for deck in self.decks.iter_mut() {
|
for deck in self.decks.iter_mut() {
|
||||||
if let Ok(normal_mut) = deck.normal_mut() {
|
if let Ok(normal_mut) = deck.normal_mut() {
|
||||||
normal_mut.config_id = 1;
|
normal_mut.config_id = 1;
|
||||||
|
normal_mut.review_limit = None;
|
||||||
|
normal_mut.new_limit = None;
|
||||||
} else {
|
} else {
|
||||||
// filtered decks are reset at import time for legacy reasons
|
// filtered decks are reset at import time for legacy reasons
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,6 +163,8 @@ impl NormalDeck {
|
||||||
if other.config_id != 1 {
|
if other.config_id != 1 {
|
||||||
self.config_id = other.config_id;
|
self.config_id = other.config_id;
|
||||||
}
|
}
|
||||||
|
self.review_limit = other.review_limit.or(self.review_limit);
|
||||||
|
self.new_limit = other.new_limit.or(self.new_limit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue