Commit graph

64 commits

Author SHA1 Message Date
Damien Elmes
9f51347e1e move bury/suspend into backend 2020-09-01 10:24:38 +10:00
Damien Elmes
988b3c00c1 move unbury/unsuspend routines into backend 2020-09-01 10:24:38 +10:00
Arthur Milchior
110f4c664f Any removed 2020-08-12 01:37:21 +02:00
Damien Elmes
e74e5c604b add daily count updating to backend 2020-06-05 19:49:53 +10:00
Damien Elmes
e534ae9aab "fix" v1 scheduler breaking after burySiblings change 2020-06-01 19:44:25 +10:00
Damien Elmes
9a4d9fdec0 tidy up sibling burying
closes #649
2020-06-01 13:48:15 +10:00
evandrocoan
1d18d5dd70 Say which card failed with an exception 2020-05-31 19:41:18 -03:00
Damien Elmes
068cc43095 storage->collection 2020-05-20 17:58:28 +10:00
Damien Elmes
ab97eaaf15 use deck tree for new/review count calculation
- wins back the performance lost by the decks and dconf not being
in memory, and the overhead of serializing data for DB calls
- card counts are no longer capped to 1000
- learn counts are currently still calculated separately - can't merge
v1 counts without changing the existing behaviour
- partially rendering the tree may yield more savings
2020-05-16 20:28:03 +10:00
Damien Elmes
07ee7d6f74 rework and merge updateCutoff
- the old "mutate but don't save" approach to resetting the "done today"
counts no longer works, and was inefficient anyway - now we just check
the day when returning the count
- remove separate implementation for v1 scheduler

This is a stop-gap solution - a bigger refactor will need to wait
until the deck/note type changes have stabilized.
2020-05-16 15:14:16 +10:00
Damien Elmes
cbfc9d5a87 handle default deck and filtered deck suppression in the backend 2020-05-15 21:21:10 +10:00
Damien Elmes
8a063a8a8c remove unused deckDueList() and associated tree code
The progress bar add-ons appear to be the only active users of it;
they can switch their old code from iterating over the list to
simply locating the selected deck in deckDueTree(), as its counts should
summarize all the child decks.
2020-05-15 18:37:12 +10:00
Arthur Milchior
6e36bc5f2e immediate_parent 2020-04-06 23:56:24 +02:00
Arthur Milchior
e6024d4d3d replace _path by path (because it's not private here) 2020-04-06 23:50:43 +02:00
Arthur Milchior
8962194dcb uses _path where possible 2020-04-06 23:50:37 +02:00
Damien Elmes
cffe146397 split deck config into separate SQL table
- on collection load, the schema is upgraded to 12
- on collection close, the changes are reversed so older clients
can continue to open the collection
- in the future, we could potentially skip the reversal except
when exporting/doing a full sync
- the same approach should work for decks, note types and tags in the
future too
- the deck list code needs updating to cache the deck confs for the
life of the call
2020-03-30 20:01:16 +10:00
Damien Elmes
369457a1c7 fix two cases where a float was being written into due 2020-03-26 19:05:18 +10:00
Damien Elmes
9d55260425 apply same list->tuple fix to v1 sched 2020-03-22 21:56:02 +10:00
Damien Elmes
e02f032a47 use backend for v1 and v2 cutoff calculations
this should also fix the CI failures, which were happening because
the datetime module wasn't matching the shifted time.time()
2020-03-22 14:28:26 +10:00
Damien Elmes
23717089e9 add the ability to provide a custom sort order; use backend for find 2020-03-21 07:55:21 +10:00
Damien Elmes
90a44509be drop usage of flushSched() 2020-03-20 21:15:23 +10:00
Damien Elmes
9e67ea736a drop named sql arguments 2020-03-20 21:15:23 +10:00
Damien Elmes
0dc4886558 add col.weakref() and fix more reference cycles in pylib 2020-03-05 09:47:47 +10:00
Arthur Milchior
d9eb170962 hooks for limit new/rev for a single deck 2020-03-04 16:11:13 +01:00
Damien Elmes
950d39571e remove a few more common methods 2020-03-04 21:33:44 +10:00
Damien Elmes
27438d8625 use _deckLimit() in a few more places 2020-03-04 21:24:09 +10:00
Damien Elmes
db00452ded reuse _leftToday() 2020-03-04 12:26:57 +10:00
Damien Elmes
7a32a0eb6f import tidyup 2020-03-04 12:25:02 +10:00
Damien Elmes
d7c3c5d3b1 reuse _deckNewLimitSingle() 2020-03-04 12:23:56 +10:00
Damien Elmes
7bd1c59abd reuse v2's _logRev() 2020-03-04 12:23:42 +10:00
Damien Elmes
7880227b43 remove duplicate methods from sched.py 2020-03-04 12:14:26 +10:00
Damien Elmes
7ab3c4ce67 make v1 scheduler inherit from v2 so we can delete duplicate code 2020-03-04 11:41:23 +10:00
Damien Elmes
28e1e01068 use weakref for backrefs so collection doesn't need to be garbage collected 2020-03-03 21:25:32 +10:00
Arthur Milchior
80e5a97e39 countsIdx return a queue type.
I missed this constant before
2020-03-01 13:00:36 +01:00
Alan Du
13a258184e Add some more types 2020-02-27 21:27:59 -05:00
Alan Du
3c2822ba4c Monkeytype pylib/anki/sched.py 2020-02-27 19:27:32 -05:00
Damien Elmes
11647daec1 move answer_button_time to the backend, split sched into separate module 2020-02-21 15:29:38 +10:00
Damien Elmes
2633d6db4b move answer button labels into fluent 2020-02-21 15:29:38 +10:00
Arthur Milchior
607bcc55c2 Reformatting through black 2020-02-04 08:47:36 -08:00
Arthur Milchior
611ce618a8 QUEUE and TYPE day learn, relearn 2020-02-04 08:47:36 -08:00
Arthur Milchior
41ffdbd504 QUEUE_TYPE_REV and CARD_TYPE_REV 2020-02-04 08:47:36 -08:00
Arthur Milchior
6d204a23ac QUEUE_TYPE_SUSPENDED 2020-02-04 08:47:36 -08:00
Arthur Milchior
49b091b3ae QUEUE_TYPE_SIBLING_BURIED 2020-02-04 08:47:36 -08:00
Arthur Milchior
44368caf55 CARD_TYPE_LRN and QUEUE_TYPE_LRN 2020-02-04 08:47:35 -08:00
Arthur Milchior
e27b2ff554 QUEUE_TYPE_NEW and CARD_TYPE_NEW 2020-02-03 02:24:37 -08:00
Arthur Milchior
0ec7f82790 REVLOG_CRAM 2020-02-03 02:24:37 -08:00
Arthur Milchior
fdb8a8a966 REVLOG_RELRN 2020-02-03 02:24:37 -08:00
Arthur Milchior
381699cae4 REVLOG_REV 2020-02-03 02:24:37 -08:00
Arthur Milchior
8c3f73c423 REVLOG_LRN 2020-02-03 02:24:37 -08:00
Arthur Milchior
273629e255 BUTTON_FOUR 2020-02-03 02:24:37 -08:00