Commit Graph

510 Commits

Author SHA1 Message Date
Karsten Lehmann
c6f82e20cd
Removed unused class MediaSyncer 2020-09-02 18:53:24 +02:00
Karsten Lehmann
471e3aead4
Removed haveDirty check from sync code
The dirty field does not exist in the media table anymore.
2020-09-02 18:53:24 +02:00
Karsten Lehmann
537bbe89c9
updated readme to reflect latest changes 2020-09-02 18:53:24 +02:00
Karsten Lehmann
4c09c1e248
fix sanity check 2020-09-02 18:53:24 +02:00
Karsten Lehmann
7eff3815a4
Always downgrade the database before sync
This prevents the missing collation unicase error on the client
2020-09-02 18:53:17 +02:00
Karsten Lehmann
e18e86e809
Log sanity check errors 2020-09-02 18:49:45 +02:00
Karsten Lehmann
93d37d6ab6
fix chunk in sync 2020-09-02 18:49:45 +02:00
Karsten Lehmann
c97a096e8a
Made sure to use ConfigManager in Syncer 2020-09-02 18:49:45 +02:00
Karsten Lehmann
8358b092a3
Hide the media managers db 2020-08-26 21:06:57 +02:00
Karsten Lehmann
b566e32597
Removed call to load method of anki.collection.Collection
This method was removed in
a2b7a3084131f747fb476cc8a24f96a00c654859
2020-08-26 18:27:05 +02:00
Karsten Lehmann
3857f15c06
Read hostkey from GET or POST
This commit applies the fix from
https://github.com/tsudoko/anki-sync-server/pull/60/files

However it using a shorter version by utilizing the params attribute of
the webob request. The params attribute combines the get and post params
2020-08-26 18:04:29 +02:00
Karsten Lehmann
bc889958dc
Added missing fields to meta endpoint 2020-08-26 16:58:36 +02:00
Karsten Lehmann
d0f7d05b44
Ported Python Syncer from Anki source code 2020-08-26 16:44:05 +02:00
Karsten Lehmann
26d16b698a
Removed unused import 2020-08-26 16:25:03 +02:00
Karsten Lehmann
f7ae69f4e6
Removed embedded anki submodule 2020-08-26 16:22:47 +02:00
Vikash Kothary
0c6a86d72b Add ankisyncd environment variables to .env.example 2020-07-30 23:06:50 +01:00
Vikash Kothary
58441cffbd Add webob as a dependency to pyproject 2020-07-30 22:18:52 +01:00
Vikash Kothary
5430b729f9 Add anki-bundled requirements to pyproject 2020-07-30 22:17:56 +01:00
Vikash Kothary
7df362bb2c Add script to lock and export requirements 2020-07-30 21:49:34 +01:00
Vikash Kothary
b31784aa6b Add jupyter lab and notebook as a dependency 2020-07-30 21:47:36 +01:00
Vikash Kothary
a0eed872de Add gitterchat markdown badge 2020-07-30 21:34:37 +01:00
Vikash Kothary
1331903c9f Add readthedocs markdown badge 2020-07-30 21:34:24 +01:00
Vikash Kothary
6a59530cd8
Merge pull request #18 from ankicommunity/feature/#10-readthedocs 2020-07-30 21:16:46 +01:00
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