- wrap request in AnkiRequestsClient so we can keep track of
upload/download bytes without having to monkey patch anything
- force a 64kB buffer size instead of the default 8kB
- show one decimal point in up/down so small requests still give
visual feedback
- update add-on downloading and update check to use requests
- remove the update throttling in aqt/sync.py, as it's not really
necessary anymore
- a few issues to work out still, and editor changes not done yet
- for communication between webengine and python code, we set window
.location to 'http://anki/<something>' - the leading http is
necessary for qt to call the link handler, which was introduced
in qt5.5
- the designer files now use a promoted qobject to create instances
of AnkiWebView
- we use the css zoom property to alter webengine font size based on
system dpi
- prefs and addons folder stored in new location (at least for now)
deletes in particular take some time for the server to process, but
don't require much bandwidth, leading to the progress appearing to
have pause when content is actually being processed
this also gives the user an idea of how long the process will take to
complete
- media syncing no longer locks the account, so it can be done
in the background in the future, and multiple clients can safely
sync media at the same time
- all operations are now idempotent, so they can be repeatedly safely
in the event of a connection error
- whether it's a normal incremental sync, an initial sync,
or the media database has been deleted, no files will be uploaded
or downloaded if they already exist on the other side
- file removals are now chunked like additions & updates, preventing
timeouts due to large requests
- if the server can't process a chunk in time, it will return a count
of what it did process, so the client can retry the rest
Notes for AnkiDroid:
- when porting this, recommend you pick a different name for the
.media.db2 file, so users don't accidentally copy the AD version to
the desktop or vice versa
- please make sure filenames are added to the zip in NFC form
- tweak sync code so that a failure in loading the collection
won't leave the app with an unopen collection
- don't show corrupt collection message when the error is not
a db error
- catch the temp folder issue when loading the collection. i suspect
this was the issue that was causing some people to end up with
an open anki instance with no collection loaded
- /sync/meta now returns a dictionary
- it includes the following extra fields
- msg: if non-empty, show this message at the end of the sync
- cont: if false, show above message and abort sync
- uname: the user's email address, so it can be stored by the local client to
show users who have forgotten which email address they used. in the future
this will be saved only when logging in, so do a conditional access on it
Python used to use C-style division, where division of two ints was
truncated, and division involving a float resulted in a float.
This is confusing, because you often can't tell from looking at a
line of code in isolation what sort of division it's supposed to do.
With 'from __future__ import division' Python ensures that division is
always explicit.
// means (floored) integer division
/ means float division
regardless of argument types.
This should make the source a bit clearer now, as well as removing one
obstacle if Anki is ever ported to Python 3.
- server will log mismatches so we don't require people to post on the forums
anymore or manually force a full sync
- if we find problems like missing notes, report that in the sanity check so
the server can keep track of problems
- when the server detects a conflict it can immediately abort the sync, so a
subsequent sync will no longer report a conflict