Damien Elmes
ff095ed57b
fix clippy lints for latest Rust
2021-06-21 13:09:36 +10:00
Damien Elmes
d76ef9cde5
update Rust deps
...
- tokio 1.0
- updated reqwest, thanks to Rumo
- other minor dep updates
the reqwest build file has been split into two, as it was awkward
to manually update the combined file, and the platform gate is now
on the target in rslib/
2021-04-27 22:18:12 +10:00
Damien Elmes
363a843d07
tidy up Rust imports
...
rustfmt can do this automatically, but only when run with a nightly
toolchain, so it needs to be manually done for now - see rslib/rusfmt.toml
2021-04-18 18:38:54 +10:00
Damien Elmes
8c635f9337
move sync/network errors into separate file
2021-04-01 17:02:54 +10:00
Damien Elmes
cc54a9251e
crate::err -> crate::error
2021-04-01 16:07:13 +10:00
Damien Elmes
a90d5aa359
use mixed case for abbreviations in Rust code
...
So, this is fun. Apparently "DeckId" is considered preferable to the
"DeckID" were were using until now, and the latest clippy will start
warning about it. We could of course disable the warning, but probably
better to bite the bullet and switch to the naming that's generally
considered best.
2021-03-27 19:53:33 +10:00
Damien Elmes
8c7c2eeda3
specify I/O timeout
...
We need to be a bit conservative here due to buffer bloat - in the
upload case on a slow link, it can appear that no I/O is happening
when a buffer is draining.
2020-08-26 18:30:51 +10:00
Damien Elmes
0787381a99
login/full up/full down plugged in
2020-06-01 13:57:10 +10:00
Damien Elmes
aaed0464e5
rework progress handling
...
- client now polls status instead of backend pushing it
- supports multiple threads
- update throttling happens in one place
2020-06-01 13:57:10 +10:00
Damien Elmes
f17dec9f2a
start on HTTP client for syncing
2020-06-01 13:57:10 +10:00
Damien Elmes
5bb4d798c1
add some timeouts
...
I'm waiting to hear back from the reqwests author on the best way to
handle this. For now, this change just adds short timeouts
to the quick requests, and will wait for up to an hour when sending/
receiving files to allow for the slow connection+large file case.
2020-04-01 10:03:54 +10:00
Damien Elmes
1d6c084c2b
fix clippy lint on other platforms
2020-03-19 10:58:52 +10:00
Damien Elmes
eae07af576
correctly handle NFD content in media DB from older Anki versions
2020-03-19 10:20:42 +10:00
Damien Elmes
387207cd86
log sync errors
2020-03-10 09:43:48 +10:00
Damien Elmes
80065f3ce2
tweak logging
2020-03-10 09:30:05 +10:00
Damien Elmes
6f9079a341
don't try to read file data when file marked as a deletion
...
If the user hadn't used the media check to clean up files with
invalid names on disk, the long filename would break the 'automatically
rename long filenames when syncing' functionality, causing the original
long filename to be uploaded to AnkiWeb as an addition instead of
a deletion
2020-03-10 09:29:36 +10:00
Damien Elmes
c97b37b7ae
make logging explicit, and support logging to a file
2020-02-29 20:44:01 +10:00
Damien Elmes
42781a696f
remove some unused imports
2020-02-29 15:21:11 +10:00
Damien Elmes
0869a78668
more frequent progress updates
2020-02-17 08:40:17 +10:00
Damien Elmes
afca40c83f
mark deletions in media DB when files are deleted
2020-02-17 08:40:17 +10:00
Damien Elmes
0869fac03a
make sure renames generated during sync don't get immediately removed
2020-02-17 08:40:17 +10:00
Damien Elmes
311fb524a4
don't filter out invalid filenames when we're sending them as a deletion
2020-02-17 08:40:17 +10:00
Damien Elmes
742ab59edb
handle read errors during zip build
2020-02-17 08:40:17 +10:00
Damien Elmes
ef522b235a
clean up invalid media DB entries on the fly, instead of requiring DB check
2020-02-17 08:40:17 +10:00
Damien Elmes
9c60f2c77e
log media DB change registration progress, and allow aborting it
2020-02-17 08:40:17 +10:00
Damien Elmes
8e31068f0a
move change tracking into separate file
2020-02-17 08:40:17 +10:00
Damien Elmes
ef14b1a96b
simplify code by accumulating stats at the source
2020-02-17 08:40:17 +10:00
Damien Elmes
b21d24f6e8
move sync_media() into MediaManager
2020-02-17 08:40:17 +10:00
Damien Elmes
e352a6b95c
tidy up sync.rs
2020-02-17 08:40:17 +10:00
Damien Elmes
08eb9d70c8
handle concurrent modifications and ankiweb terminating early
2020-02-17 08:40:17 +10:00
Damien Elmes
3ee1d3f0da
update dirmod as files added during sync
2020-02-17 08:40:17 +10:00
Damien Elmes
775c83e89a
add debug line
2020-02-17 08:40:17 +10:00
Damien Elmes
c0e7975fe7
rename non-normalized filenames when downloading
2020-02-17 08:40:17 +10:00
Damien Elmes
1f931a5b78
defer errors on upload to media check
2020-02-17 08:40:17 +10:00
Damien Elmes
2cecae4ca7
add proper version
2020-02-17 08:40:16 +10:00
Damien Elmes
77158760ff
use enums for some common errors
2020-02-17 08:40:16 +10:00
Damien Elmes
b883b09414
pass in endpoint
2020-02-17 08:40:16 +10:00
Damien Elmes
738e415463
connect media sync progress to Python, add a progress dialog
2020-02-17 08:40:16 +10:00
Damien Elmes
50d8a40e23
add progress hook to media sync
2020-02-17 08:40:16 +10:00
Damien Elmes
e764e68324
store sync state in a struct, and reuse ctx across methods
2020-02-17 08:40:16 +10:00
Damien Elmes
78bfbef863
media sync working, but unpolished
2020-02-17 08:40:16 +10:00