Commit graph

57 commits

Author SHA1 Message Date
Damien Elmes
bbac32b477 ensure lapsed reviews are scheduled for tomorrow on graduate 2012-04-07 14:28:41 +09:00
Damien Elmes
2f75e99671 ntype -> note 2012-04-07 13:53:55 +09:00
Damien Elmes
2ba5f80cf1 fix field searching and negated field searching 2012-04-07 13:53:03 +09:00
Damien Elmes
73bdad9d70 model:foo is ntype:foo in searches now 2012-03-30 00:03:39 +09:00
Damien Elmes
f7fe1c6590 fix tag:none 2012-03-27 11:18:16 +09:00
Damien Elmes
ccb0c08c9c another find&replace bug 2012-03-24 19:03:14 +09:00
Damien Elmes
ce86670c76 find&replace should ignore notes without provided field 2012-03-24 04:06:51 +09:00
Damien Elmes
f1140cf886 fix inverted deck search case 2012-03-20 02:49:06 +09:00
Damien Elmes
7c712274d8 deck: searches should find it both original and current deck 2012-03-19 22:53:40 +09:00
Damien Elmes
820308e45e fix args in addSearchFieldToken 2012-03-19 21:50:09 +09:00
Damien Elmes
01404fafaa start of cram refactor 2012-03-08 16:47:22 +09:00
Damien Elmes
4f1bcb9356 fix is:recent 2012-01-24 01:04:49 +09:00
Damien Elmes
a9c46b5ccb include subdecks when restricting to deck 2011-12-15 11:57:55 +09:00
Damien Elmes
95106908dd check sort field when searching
If the field they want to search is the one being used to sort, this saves us
having to go the full search route
2011-12-08 09:53:27 +09:00
Damien Elmes
74518264e0 raise an exception when an invalid sort type is passed 2011-11-30 12:34:49 +09:00
Damien Elmes
be3258b0a8 fix field limiting 2011-11-28 20:51:47 +09:00
Damien Elmes
73b80211c2 add current deck limit 2011-11-28 20:48:14 +09:00
Damien Elmes
8c1266ab2a less terse card state searches 2011-11-28 20:18:16 +09:00
Damien Elmes
67e4f0d1cc tweak find code 2011-11-28 20:04:39 +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
bc9f6e6a24 add USNs
Decks now have an "update sequence number". All objects also have a USN, which
is set to the deck USN each time they are modified. When syncing, each side
sends any objects with a USN >= clientUSN. When objects are copied via sync,
they have their USNs bumped to the current serverUSN. After a sync, the USN on
both sides is set to serverUSN + 1.

This solves the failing three way test, ensures we receive all changes
regardless of clock drift, and as the revlog also has a USN now, ensures that
old revlog entries are imported properly too.

Objects retain a separate modification time, which is used for conflict
resolution, deck subscriptions/importing, and info for the user.

Note that if the clock is too far off, it will still cause confusion for
users, as the due counts may be different depending on the time. For this
reason it's probably a good idea to keep a limit on how far the clock can
deviate.

We still keep track of the last sync time, but only so we can determine if the
schema has changed since the last sync.

The media code needs to be updated to use USNs too.
2011-09-13 21:10:21 +09:00
Damien Elmes
78600e8ed6 move group code into a registry like models 2011-08-27 23:45:55 +09:00
Damien Elmes
d3a3edb707 move models into the deck table
Like the previous change, models have been moved from a separate DB table to
an entry in the deck. We need them for many operations including reviewing,
and it's easier to keep them in memory than half on disk with a cache that
gets cleared every time we .reset(). This means they are easily serialized as
well - previously they were part Python and part JSON, which made access
confusing.

Because the data is all pulled from JSON now, the instance methods have been
moved to the model registry. Eg:
  model.addField(...) -> deck.models.addField(model, ...).

- IDs are now timestamped as with groups et al.

- The data field for plugins was also removed. Config info can be added to
  deck.conf; larger data should be stored externally.

- Upgrading needs to be updated for the new model structure.

- HexifyID() now accepts strings as well, as our IDs get converted to strings
  in the serialization process.
2011-08-27 22:27:09 +09:00
Damien Elmes
7afe6a9a7d convert groups to json; use timestamp ids for all but default
Rather than use a combination of id lookups on the groups table and a group
configuration cache in the scheduler, I've moved the groups and group config
into json objects on the deck table. This results in a net saving of code and
saves one or more DB lookups on each card answer, in exchange for a small
increase in deck load/save work.

I did a quick survey of AnkiWeb, and the vast majority of decks use less than
100 tags, and it's safe to assume groups will follow a similar pattern.

All groups and group configs except the default one will use integer
timestamps now, to simplify merging when syncing and importing.

defaultGroup() has been removed in favour of keeping the models up to date
(not yet done).
2011-08-27 17:13:04 +09:00
Damien Elmes
644a885a07 update fact ids, graves
- should never skip recording graves, for the sake of merging
- 1.0 upgrade will fail on decks that have the same fact creation date. need
      to work around this in the future
2011-08-26 21:23:16 +09:00
Damien Elmes
a65f241258 gracefully handle invalid queries 2011-04-29 11:46:26 +09:00
Damien Elmes
2243b691cc add full search to ignore formatting 2011-04-28 09:24:03 +09:00
Damien Elmes
8b747c3aac allow the user to choose if case should be folded 2011-04-28 09:24:03 +09:00
Damien Elmes
bee14e1a0b make fieldNames() available for gui code too 2011-04-28 09:24:03 +09:00
Damien Elmes
d51cd5a433 find & replace 2011-04-28 09:24:03 +09:00
Damien Elmes
8c1c729544 fix card state negation 2011-04-28 09:24:02 +09:00
Damien Elmes
437b4780c0 add missing cardIvl sort 2011-04-28 09:24:02 +09:00
Damien Elmes
1b3548f164 fix sorting by ease 2011-04-28 09:24:02 +09:00
Damien Elmes
2a225b1fae use the sort property set in the deck 2011-04-28 09:24:02 +09:00
Damien Elmes
d089deae5a add the ability to reverse sort order 2011-04-28 09:24:02 +09:00
Damien Elmes
6617214708 add recent list; fix groups 2011-04-28 09:24:02 +09:00
Damien Elmes
7ffff24790 fix case where multiple models have the same template 2011-04-28 09:24:02 +09:00
Damien Elmes
d6116a5377 model and group searching 2011-04-28 09:24:02 +09:00
Damien Elmes
9ebbdc2be1 sort by card ordinal after fact sort 2011-04-28 09:24:02 +09:00
Damien Elmes
efe6177c7a refactor ordering 2011-04-28 09:24:02 +09:00
Damien Elmes
291bd399b7 field searching
dropped support for field:foo, as you can type 'foo:' instead to accomplish
the same thing
2011-04-28 09:24:01 +09:00
Damien Elmes
57938927e7 users can pass a number for template ordinal; makes show:one obsolete 2011-04-28 09:24:01 +09:00
Damien Elmes
94d4e319ae fids and template searches 2011-04-28 09:24:01 +09:00
Damien Elmes
a13c18cf4b start refactoring find code 2011-04-28 09:24:01 +09:00
Damien Elmes
2343222245 remove rest of q/a searching 2011-04-28 09:24:01 +09:00
Damien Elmes
69a9d665e3 question/answer searching is obsolete 2011-04-28 09:24:01 +09:00
Damien Elmes
2dfdfad6f2 update license link 2011-04-28 09:24:01 +09:00
Damien Elmes
8fcc6b3085 gpl3->agpl 2011-04-28 09:24:01 +09:00