fix spurious warning in db check for v1 scheduler+non-zero lapse ivl%

https://forums.ankiweb.net/t/invalid-property-on-card-not-resolving-via-recommended-check-database/8430
This commit is contained in:
Damien Elmes 2021-03-19 22:57:43 +10:00
parent 2ab39e7c76
commit f7e4b6d822
3 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@
use crate::{
collection::Collection,
config::SchedulerVersion,
err::{AnkiError, DBErrorKind, Result},
i18n::{tr_args, I18n, TR},
notetype::{
@ -172,6 +173,7 @@ impl Collection {
timing.days_elapsed,
TimestampSecs::now(),
self.usn()?,
self.scheduler_version() == SchedulerVersion::V1,
)?;
out.card_position_too_high = new_cnt;
out.card_properties_invalid += other_cnt;

View File

@ -6,6 +6,7 @@ SET odue = (
type = 1
OR queue = 2
)
AND NOT ?3
AND NOT odid THEN 0
ELSE min(max(round(odue), -2147483648), 2147483647)
END
@ -19,6 +20,7 @@ WHERE odue != (
type = 1
OR queue = 2
)
AND NOT ?3
AND NOT odid THEN 0
ELSE min(max(round(odue), -2147483648), 2147483647)
END

View File

@ -230,6 +230,7 @@ impl super::SqliteStorage {
today: u32,
mtime: TimestampSecs,
usn: Usn,
v1_sched: bool,
) -> Result<(usize, usize)> {
let new_cnt = self
.db
@ -242,7 +243,7 @@ impl super::SqliteStorage {
other_cnt += self
.db
.prepare(include_str!("fix_odue.sql"))?
.execute(params![mtime, usn])?;
.execute(params![mtime, usn, v1_sched])?;
other_cnt += self
.db
.prepare(include_str!("fix_ivl.sql"))?