Commit graph

217 commits

Author SHA1 Message Date
Damien Elmes
779bcbef39 ensure crt synced 2012-07-18 11:19:30 +09:00
Damien Elmes
c5abb535ed don't delete orphaned notes on sync
Fields are synced later, and they may prevent a note from becoming orphaned
2012-07-04 22:41:21 +09:00
Damien Elmes
c8b2b5ff87 look for certs in bundled location 2012-06-03 21:44:04 +09:00
Damien Elmes
8fd920fce1 catch upgraderequired response 2012-05-30 16:09:52 +09:00
Damien Elmes
229b7d1b22 use primary url 2012-05-28 20:37:25 +09:00
Damien Elmes
a84a95cb1a fix ProxyInfo() call 2012-05-23 08:43:38 +09:00
Damien Elmes
5aa840e848 handle proxy config in libanki 2012-05-22 14:14:40 +09:00
Damien Elmes
e644cc1faa allow the default proxy to be overridden 2012-05-20 18:29:43 +09:00
Damien Elmes
461e240d53 allow python-bundled json 2012-04-28 17:41:56 +09:00
Damien Elmes
cb1e4d4645 check for missing parents on sync 2012-04-08 09:06:33 +09:00
Damien Elmes
f6b2e69669 remove did from notes, use model did instead 2012-03-09 09:12:27 +09:00
Damien Elmes
a2312f9a1f change cards table schema
In preparation for cramming:

- add odid for storing old deck on a per-card basis
- rename edue to odue
- at the moment note.did still exists, but in the future we may ignore it and
  use model.did instead
2012-03-08 11:28:12 +09:00
Damien Elmes
b89dde97a8 fix deck syncing problems
- delete only the decks with graves, not any children
- make sure we log the deletion even if the deck didn't exist
2012-02-02 09:52:07 +09:00
Damien Elmes
1800f30776 correctly detect when we don't have a deck conf 2012-01-30 07:31:15 +09:00
Damien Elmes
3c995017fe force save after sync 2012-01-26 08:07:27 +09:00
Damien Elmes
19435068bb break removals into separate sync step 2011-12-14 11:42:19 +09:00
Damien Elmes
dc89e34410 fix deck conf syncing 2011-12-13 13:58:31 +09:00
Damien Elmes
bacbea13e0 conf() -> confForDid(); add getConf() 2011-12-13 13:56:05 +09:00
Damien Elmes
0a677fee56 sync tweaks 2011-12-13 10:44:50 +09:00
Damien Elmes
08660f6bf8 test db integrity before upload 2011-12-08 01:06:33 +09:00
Damien Elmes
6ce8c9b608 drop tags from sanity check
Since we rely on fixIntegrity() to garbage-collect tags and don't try to add
unused ones to the graves, after a check the tag counts will fall out of sync.
2011-12-07 18:33:43 +09:00
Damien Elmes
593e45a9bb decrease timeout to 30; httplib2 retries for us 2011-12-07 18:08:15 +09:00
Damien Elmes
4b190c3586 run all sync requests through one function 2011-12-07 17:57:07 +09:00
Damien Elmes
9b76a4669c compress zip, add media sanity check 2011-12-06 23:36:01 +09:00
Damien Elmes
fabec6e920 more sync resuming changes
The server now returns the next usn after every addFiles(), so an interrupted
upload doesn't cause the uploaded material to be sent back down.
2011-12-06 23:04:26 +09:00
Damien Elmes
be66c960a9 rework media syncing so we can resume 2011-12-06 22:18:41 +09:00
Damien Elmes
c0edcae238 fix some sync bugs
- don't send server graves graves back on the next sync
- make sure we update usns of models/tags/decks as well on upload
- don't die when updating decks after current deck deleted
- report counts when sanity check fails
2011-12-06 01:35:54 +09:00
Damien Elmes
4a88885e83 default to compression level 6 2011-12-06 00:05:39 +09:00
Damien Elmes
8308c79fa6 minor refactor of count handling
- drop lrnCount; rename lrnRepCount to lrnCount
- on card fetch, decr count by card.left
- drop cardCounts(), rename repCounts() to just counts()
- fix lrn count bugs
2011-12-05 19:15:46 +09:00
Damien Elmes
41636f41f8 tweak sync error handling 2011-12-05 17:44:54 +09:00
Damien Elmes
0395047579 initial usn is 0, so distinguish between 0 and false 2011-12-05 15:27:06 +09:00
Damien Elmes
b33c2e99c0 return false, not 'continue', when not finished 2011-12-05 14:43:32 +09:00
Damien Elmes
1ec747dbb4 tweak sync hooks 2011-12-04 15:56:38 +09:00
Damien Elmes
6bad4cc8c2 fix sanity check 2011-12-04 15:23:43 +09:00
Damien Elmes
9d5357f7a6 after a save, revert to unmodified state; sync tweaks 2011-12-04 14:56:12 +09:00
Damien Elmes
8fff05618c check download before overwrite 2011-12-03 22:15:36 +09:00
Damien Elmes
6965a9c102 sync tweaks 2011-12-03 21:06:27 +09:00
Damien Elmes
d148a6cf1b bundle ssl certs; share con across all sync types 2011-12-03 16:38:45 +09:00
Damien Elmes
92352d4725 convert guid to base 91 string
Because JSON doesn't support 64 bit numbers, we need to either convert the 64
bit numbers to a string during transport, or store the ids as a string. At
base 91 a 64 bit number only takes an extra two bytes, and it means we can
dump DB results directly into JSON without having to apply any transformation.
2011-12-03 14:25:18 +09:00
Damien Elmes
b5c0b1f2c7 drop required/unique field properties
Instead of having required and unique flags for every field, enforce both
requirements on the first field, and neither on the rest. This mirrors the
subject/body format people are used to in note-taking apps. The subject
defines the object being learnt, and the remaining fields represent properties
of that object.

In the past, duplicate checking served two purposes: it quickly notified the
user that they're entering the same fact twice, and it notified the user if
they'd accidentally mistyped a secondary field. The former behaviour is
important for avoiding wasted effort, and so it should be done in real time.
The latter behaviour is not essential however - a typo is not wasted effort,
and it could be fixed in a periodic 'find duplicates' function. Given that
some users ended up with sluggish decks due to the overhead a large number of
facts * a large number of unique fields caused, this seems like a change for
the better.

This also means Anki will let you add notes as long as as the first field has
been filled out. Again, this is not a big deal: Anki is still checking to make
sure one or more cards will be generated, and the user can easily add any
missing fields later.

As a bonus, this change simplifies field configuration somewhat. As the card
layout and field dialogs are a popular point of confusion, the more they can
be simplified, the better.
2011-11-24 22:16:03 +09:00
Damien Elmes
f7790275ce groups -> decks 2011-11-23 19:28:09 +09:00
Damien Elmes
279a942642 deck -> collection 2011-11-23 17:47:44 +09:00
Damien Elmes
6e4e8249fb facts -> notes 2011-11-23 12:37:21 +09:00
Damien Elmes
c6c6af4328 split remote sync tests into separate file 2011-11-07 16:21:29 +09:00
Damien Elmes
0c85acf3f7 refactor to support early exit when no media changes
- regular sync now receives a media USN as well
- server bumps media usn not only on sync but any other media change
- added local media.hasChanged()
2011-10-06 15:34:22 +09:00
Damien Elmes
b4fdf1c690 send 'continue' for multiple zips; test splitting 2011-10-06 13:51:44 +09:00
Damien Elmes
8c1f397459 ensure successive calls work 2011-10-06 13:25:01 +09:00
Damien Elmes
0a52f55e50 test removing too 2011-10-06 13:06:32 +09:00
Damien Elmes
eca6ef204f check file is added on remote test 2011-10-03 13:42:53 +09:00
Damien Elmes
49181ee738 fix media zipping and addFiles call 2011-10-03 12:59:35 +09:00