I have a few python scripts for manipulating my decks which work great but I’d also like to be able to sync my collection without starting up the desktop app. I wrote a simple little funciton like this which gets the SyncAuth object and passes it to Collection.sync_collection, like so:
def sync_deck():
auth = col.sync_login("username", "password")
col.sync_collection(auth)
However I get this exception:
…\env\lib\site-packages\anki_backend_init_.py", line 131, in _run_command
raise backend_exception_to_pylib(err)
anki.errors.DBError: DbError { info: “SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some(“cannot start a transaction within a transaction”))”, kind: Other }
Any ideas why this is the case, have I missed a key enabling step?
Thank you,
Ben