diff --git a/pylib/anki/collection.py b/pylib/anki/collection.py index 77eab8716..6ac769814 100644 --- a/pylib/anki/collection.py +++ b/pylib/anki/collection.py @@ -196,7 +196,7 @@ class Collection: # Until we can move away from long-running transactions, the Python # code needs to know if transaction should be committed, so we need # to check if the backend updated the modification time. - return self.db.last_begin_at <= self.mod + return self.db.last_begin_at != self.mod def save( self, name: Optional[str] = None, mod: Optional[int] = None, trx: bool = True diff --git a/pylib/anki/dbproxy.py b/pylib/anki/dbproxy.py index e555c74b3..1a9c024ff 100644 --- a/pylib/anki/dbproxy.py +++ b/pylib/anki/dbproxy.py @@ -30,7 +30,7 @@ class DBProxy: ############### def begin(self) -> None: - self.last_begin_at = anki.utils.intTime(1000) + self.last_begin_at = self.scalar("select mod from col") self._backend.db_begin() def commit(self) -> None: