Skip to content

Updating anki-bundled past 2.1.16+ #67

@genedan

Description

@genedan

I tried updating anki-bundled to 2.1.26, and while I was able to get the server started and do an initial upload, downloading a full sync failed.

Some observations:

  1. You'll need to install rust and other dependencies and then compile anki, the instructions of which are in README.development.

  2. The python modules are now in anki-bundled/anki/pylib/anki, so I tried changing line 5 in ankisyncd/init.py from:

sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), "anki-bundled"))

to

sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), "anki-bundled/pylib"))

  1. If you try running anki-sync-server at this point, you'll get an error saying that there is no module named ankirspy. You'll need to install it, but the build hash of ankirpsy needs to match anki 2.1.26, so

pip3 install ankirspy==2.1.26

  1. If you try running anki-sync-server again, you'll get an error saying 'EnumTypeWrapper' object has no attribute INTERVALS. In anki-bundled/anki/pylib/anki/rsbackend.py, line 168:

FormatTimeSpanContext = pb.FormatTimeSpanIn.Context

pb.FormatTimeSpanIn.Context has no attribute INTERVALS, but pb.FormatTimeSpanIn does, so I tried changing it to:

FormatTimeSpanContext = pb.FormatTimeSpanIn

  1. Now you can start anki-sync-server and upload some cards. However trying to download a collection from the server to a new profile fails with the error:

'_Collection' object has no attribute 'reopen'

According to this commit:

ankitects/anki@fa12213#diff-286ad1cf4f79bc4880ecbcc7c6a09062

It seems that reopen() has been moved from _Collection to class AnkiQt in /anki/qt/aqt/main.py

I'm not exactly sure what to do now, but that's where I'm at. I figure it's worth figuring out, since with all the changes that have happened since 2.1.16 and the introduction of the rust backend, etc., it seems like a major change to the way the collection is being synced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions