mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
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:
parent
2ab39e7c76
commit
f7e4b6d822
3 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
collection::Collection,
|
collection::Collection,
|
||||||
|
config::SchedulerVersion,
|
||||||
err::{AnkiError, DBErrorKind, Result},
|
err::{AnkiError, DBErrorKind, Result},
|
||||||
i18n::{tr_args, I18n, TR},
|
i18n::{tr_args, I18n, TR},
|
||||||
notetype::{
|
notetype::{
|
||||||
|
@ -172,6 +173,7 @@ impl Collection {
|
||||||
timing.days_elapsed,
|
timing.days_elapsed,
|
||||||
TimestampSecs::now(),
|
TimestampSecs::now(),
|
||||||
self.usn()?,
|
self.usn()?,
|
||||||
|
self.scheduler_version() == SchedulerVersion::V1,
|
||||||
)?;
|
)?;
|
||||||
out.card_position_too_high = new_cnt;
|
out.card_position_too_high = new_cnt;
|
||||||
out.card_properties_invalid += other_cnt;
|
out.card_properties_invalid += other_cnt;
|
||||||
|
|
|
@ -6,6 +6,7 @@ SET odue = (
|
||||||
type = 1
|
type = 1
|
||||||
OR queue = 2
|
OR queue = 2
|
||||||
)
|
)
|
||||||
|
AND NOT ?3
|
||||||
AND NOT odid THEN 0
|
AND NOT odid THEN 0
|
||||||
ELSE min(max(round(odue), -2147483648), 2147483647)
|
ELSE min(max(round(odue), -2147483648), 2147483647)
|
||||||
END
|
END
|
||||||
|
@ -19,6 +20,7 @@ WHERE odue != (
|
||||||
type = 1
|
type = 1
|
||||||
OR queue = 2
|
OR queue = 2
|
||||||
)
|
)
|
||||||
|
AND NOT ?3
|
||||||
AND NOT odid THEN 0
|
AND NOT odid THEN 0
|
||||||
ELSE min(max(round(odue), -2147483648), 2147483647)
|
ELSE min(max(round(odue), -2147483648), 2147483647)
|
||||||
END
|
END
|
||||||
|
|
|
@ -230,6 +230,7 @@ impl super::SqliteStorage {
|
||||||
today: u32,
|
today: u32,
|
||||||
mtime: TimestampSecs,
|
mtime: TimestampSecs,
|
||||||
usn: Usn,
|
usn: Usn,
|
||||||
|
v1_sched: bool,
|
||||||
) -> Result<(usize, usize)> {
|
) -> Result<(usize, usize)> {
|
||||||
let new_cnt = self
|
let new_cnt = self
|
||||||
.db
|
.db
|
||||||
|
@ -242,7 +243,7 @@ impl super::SqliteStorage {
|
||||||
other_cnt += self
|
other_cnt += self
|
||||||
.db
|
.db
|
||||||
.prepare(include_str!("fix_odue.sql"))?
|
.prepare(include_str!("fix_odue.sql"))?
|
||||||
.execute(params![mtime, usn])?;
|
.execute(params![mtime, usn, v1_sched])?;
|
||||||
other_cnt += self
|
other_cnt += self
|
||||||
.db
|
.db
|
||||||
.prepare(include_str!("fix_ivl.sql"))?
|
.prepare(include_str!("fix_ivl.sql"))?
|
||||||
|
|
Loading…
Reference in a new issue