Commit Graph

287 Commits

Author SHA1 Message Date
Vikash Kothary
241f5c0eef Add .readthedocs.yml to specify mkdocs.yml path 2020-07-30 20:50:50 +01:00
Vikash Kothary
b8c27ef1e6 Add docs command to build and serve documentation 2020-07-30 20:22:31 +01:00
Vikash Kothary
afedcf719e Generate mkdocs markdown documentation 2020-07-30 20:20:24 +01:00
Vikash Kothary
cfeb466e13 Add mkdocs dependency to build documentation 2020-07-30 20:20:24 +01:00
Vikash Kothary
e5695dd229 Add print-env command to print env variable 2020-07-30 20:19:26 +01:00
Vikash Kothary
2cdb1ca98f Add pyproject.toml 2020-07-30 20:11:45 +01:00
Vikash Kothary
f637e83627 Add Makefile to simplify development commands 2020-07-30 20:09:39 +01:00
Vikash Kothary
088e7ae1ac Add config folder to support multiple environments 2020-07-30 20:00:39 +01:00
Vikash Kothary
c4ee2da949 Move anki submodule into src folder 2020-07-30 19:59:37 +01:00
Vikash Kothary
09da3d7337 Move packages into src folder 2020-07-30 19:21:40 +01:00
Vikash Kothary
125f7bb1b5
Merge pull request #15 from ankicommunity/feature/view-collections 2020-06-27 00:50:56 +01:00
Vikash Kothary
b85838d522 Add notebook to read collections 2020-06-27 00:48:50 +01:00
Vikash Kothary
d2968f37b3 Add gitignore for python and jupyter notebooks 2020-06-27 00:46:47 +01:00
Vikash Kothary
c6205a1c43
Merge pull request #12 from kalehmann/patch-1
fixed: Dead link to 2.1 addon folder in Readme
2020-06-08 23:29:22 +01:00
Karsten Lehmann
9fde78ec7e
fix: Link to 2.1 addon folder in Readme 2020-06-08 23:04:05 +02:00
flan
41205c0b92 Add test for renaming media
This test fails on current master; might or might not be related to #49
2020-02-03 17:20:37 +01:00
flan
3c440621d2 Prevent infinite loop in client when first changed usn != lastUsn
Anki expects the last change in the list to have the server's lastUsn.

Reference: cca3fcb241/anki/sync.py (L720)
2020-01-26 20:47:14 +01:00
gzz
2bfccf7fa4 offset param 2020-01-17 16:30:43 +08:00
flan
3b8fe9e7f3 Use max(x) instead of ORDER BY x DESC LIMIT 1
Doesn't use non-standard syntax, clearer intent, reportedly faster
2020-01-04 05:51:33 +01:00
flan
e8850f2a5a Migrate old media DB if present 2020-01-04 05:51:33 +01:00
flan
e8f274ee84 Fix long media sync times on AnkiDroid
Based on PR #44 by Johannes Schirm <https://github.com/Marth68>.
The code is pretty much the same, but with usn used instead of
mtime for determining which media files have changed since last
sync.

Relevant excerpt from #44:
> The server was always sending metadata for all files in the
> collection as a response to the mediaChanges operation. Because
> AnkiDroid then calculates checksums for all these files (just to
> notice that they actually haven't changed), it took larger
> collections very long to sync after every media change. With this
> fix, only the number of files indicated by usn - lastUsn (and
> mtime) are considered for each sync.

Fixes #26, closes #44.
2020-01-04 05:51:33 +01:00
flan
10f47611bf Store media usn per-file
Since anki.media.MediaManager does not store per-file usn (as it's
not really needed for anything in the client), this requires us to
drop it and implement a custom media manager.
2020-01-04 05:51:33 +01:00
flan
ac1920d078 Make SyncMediaHandler not inherit anki.sync.MediaSyncer
All endpoints are implemented in the child class now, so there's
no need to use any code from the parent class.
2020-01-04 05:51:33 +01:00
flan
c4730b1596 Add test for #44 2020-01-04 05:51:33 +01:00
flan
c07fe0e65c Print version on startup
The version is determined from either the contents of _version.py
(expected to be present in release tarballs) or the output of
`git describe --always`.
2020-01-04 05:39:24 +01:00
flan
aaf7e8b5e8 Update manager examples in config 2020-01-04 05:01:39 +01:00
flan
316e553681 Make comment for SyncCollectionHandler.removed() less confusing 2020-01-03 03:03:21 +01:00
flan
7f551f47f7 Remove unused argument to logger.error() 2020-01-03 03:02:42 +01:00
flan
7ef3d4f3fa Fix full sync on Windows
From <https://docs.python.org/3.7/library/os.html#os.rename>:
> On Windows, if dst already exists, OSError will be raised even if
> it is a file.
...
> If you want cross-platform overwriting of the destination, use
> replace().

Thanks to kerry liu (https://github.com/hqzxjczx) for reporting this.

Fixes #32.
2019-04-16 19:57:24 +02:00
flan
b9a1203491 Don't create DBs during schema check if they don't exist 2019-03-16 15:24:46 +01:00
flan
02fecc4e0a Clarify wording (development headers)
Should make #29 less likely to happen
2019-03-14 01:13:52 +01:00
flan
7fe7b97475 Update anki-bundled to 2.1.11 2019-03-14 01:09:02 +01:00
flan
d8a0853479 Make migrate_user_tables.py executable 2019-03-14 00:48:47 +01:00
flan
9986266b07 Update table of contents 2019-03-14 00:48:13 +01:00
flan
5ad14b01b4 Notify the user about DB migrations 2019-03-14 00:45:29 +01:00
Anton Melser
4652642bcd Add user -> username column name migration script 2019-03-09 14:08:18 +08:00
Anton Melser
6c82bad882 Add commented examples to conf file and update Readme.md 2019-03-09 14:08:16 +08:00
Anton Melser
fa89b0e0a2 Load the CollectionWrapper from a factory method
This allows a class implementing CollectionWrapper's interface to be
added from config
2019-03-09 14:05:15 +08:00
Anton Melser
9ee9697582 Move the upload/download sqlite3 file logic to a manager
Also add a factory method so the manager can be controlled via config
2019-03-09 14:05:15 +08:00
Anton Melser
50cc6a12d9 Use factory method for session_manager
Also add some abstraction over the SQL to allow for different SQL
dialects
2019-03-09 14:05:15 +08:00
Anton Melser
ea0cbc669b Use factory method for user_manager
Also add some abstraction over the SQL to allow for different SQL
dialects
2019-03-09 14:05:12 +08:00
flan
bfeaeae2e5 Credit dsnopek 2019-03-08 21:54:54 +01:00
tsudoko
e3e362707a
Add table of contents to README 2019-03-08 20:46:42 +00:00
flan
7b408bdf5b Don't log very long strings unless debugging 2019-03-08 17:00:59 +01:00
flan
4fe378adce Add username field to CollectionWrapper 2019-03-08 14:24:58 +01:00
flan
5051144124 Include request parameters in log messages 2019-03-08 14:24:58 +01:00
flan
f5b6cf464d Include time in log messages 2019-03-08 14:24:58 +01:00
flan
fe635b317f Use logging module for HTTP request logging too 2019-03-08 14:24:58 +01:00
flan
47cf75d8d6 Log all ankisyncd events under ankisyncd.* 2019-03-08 14:24:58 +01:00
flan
4214fc3da0 Apply custom server settings per-profile 2019-03-08 14:22:47 +01:00