mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
Increase parent limits in custom study when 'limits start from top' is enabled (#2971)
Closes #2965.
This commit is contained in:
parent
69a51ec296
commit
e7a2242262
1 changed files with 7 additions and 0 deletions
|
@ -42,6 +42,8 @@ impl Collection {
|
||||||
|
|
||||||
/// Modify the deck's limits by adjusting the 'done today' count.
|
/// Modify the deck's limits by adjusting the 'done today' count.
|
||||||
/// Positive values increase the limit, negative value decrease it.
|
/// Positive values increase the limit, negative value decrease it.
|
||||||
|
/// If global parent limits are enabled, the deck's parents are adjusted as
|
||||||
|
/// well.
|
||||||
/// Caller should ensure a transaction.
|
/// Caller should ensure a transaction.
|
||||||
pub(crate) fn extend_limits(
|
pub(crate) fn extend_limits(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -57,6 +59,11 @@ impl Collection {
|
||||||
};
|
};
|
||||||
if let Some(mut deck) = self.storage.get_deck(did)? {
|
if let Some(mut deck) = self.storage.get_deck(did)? {
|
||||||
self.update_deck_stats_single(today, usn, &mut deck, mutator)?;
|
self.update_deck_stats_single(today, usn, &mut deck, mutator)?;
|
||||||
|
if self.get_config_bool(BoolKey::ApplyAllParentLimits) {
|
||||||
|
for mut parent in self.storage.parent_decks(&deck)? {
|
||||||
|
self.update_deck_stats_single(today, usn, &mut parent, mutator)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue