From 163a9df88683603b33dd3c70fb40b5c556011de6 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 28 Jan 2021 08:11:35 +1000 Subject: [PATCH] avoid bumping mtime when correcting card eases on upgrade The USN is still set, which should cause the cards to sync in the non-conflict case, but if changes have been made on other devices the ease fix will not take priority, as we could be overwriting the reviews of someone who has not synced in a while. --- rslib/src/storage/card/fix_low_ease.sql | 3 +-- rslib/src/storage/card/mod.rs | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/rslib/src/storage/card/fix_low_ease.sql b/rslib/src/storage/card/fix_low_ease.sql index 23e5a97e4..c2c5d22e1 100644 --- a/rslib/src/storage/card/fix_low_ease.sql +++ b/rslib/src/storage/card/fix_low_ease.sql @@ -1,7 +1,6 @@ UPDATE cards SET factor = 2500, - usn = ?, - mod = ? + usn = ? WHERE factor != 0 AND factor <= 2000 AND ( diff --git a/rslib/src/storage/card/mod.rs b/rslib/src/storage/card/mod.rs index eef2f81b0..5f733bfe6 100644 --- a/rslib/src/storage/card/mod.rs +++ b/rslib/src/storage/card/mod.rs @@ -404,9 +404,7 @@ impl super::SqliteStorage { ids_to_string(&mut ids, &affected_decks); let sql = include_str!("fix_low_ease.sql").replace("DECK_IDS", &ids); - self.db - .prepare(&sql)? - .execute(params![self.usn(server)?, TimestampSecs::now()])?; + self.db.prepare(&sql)?.execute(params![self.usn(server)?])?; Ok(()) }