Commit graph

488 commits

Author SHA1 Message Date
Damien Elmes
cdac2bf8d7 workaround card ordering bug from older versions 2010-12-09 10:43:45 +09:00
Damien Elmes
3491a5e378 add an index for modified to speed up sync.summary()
testing indicates this can produce a 2x performance improvement on lastSync=0,
and much more for partial syncs
2010-12-08 15:59:16 +09:00
Damien Elmes
fe97616ecd add temporary index for priority 2010-12-08 15:38:06 +09:00
Damien Elmes
05f60c49c8 add rebuild arg for minimal startup
this bypasses rebuilding the queue and other startup initialization and thus
loads the deck considerably faster. This is useful when you want to perform
operations on the deck like syncing, but don't need the ability to review
cards
2010-12-08 15:28:28 +09:00
Damien Elmes
9f91e904b2 re-enable locked check 2010-12-07 17:18:17 +09:00
Damien Elmes
1a5c8d2435 fix from marcus for "field":value search 2010-12-07 17:13:25 +09:00
Damien Elmes
0194296839 failed cards at end if !delay0 && !failedCardMax 2010-12-07 16:55:03 +09:00
Damien Elmes
2a8ef89ee5 remove unused binding 2010-12-07 07:26:33 +09:00
Damien Elmes
a2cd19f49a tell users how they can disable the move check 2010-12-05 17:43:54 +09:00
Damien Elmes
7dd57887d0 update learn more for new spacing 2010-12-02 06:48:45 +09:00
Damien Elmes
b5dd8a9f4b update cram code for new spacing 2010-12-02 06:47:16 +09:00
Damien Elmes
bac4acdaa8 reworked handling of spaced cards; add cms argument to previewFact()
- obsolete spaceUntil - it serves no useful purpose
- the old per-model spacing variables are obsolete, as the new approach
  requires uniform spacing across all models for new cards
- introduce a new per-deck variable: newSpacing
- don't fill new queue if we've done today's cards
- still need to check cramming / review early

newSpacing is a time in seconds to delay introduction of sibling new cards.
It can be applied as many times as necessary as there is no harm in new cards
being delayed repeatedly. Because the default queue length is 200 and it can
take quite some time for the spaced cards to be placed in the queue again, we
use a separate array to track spaced new cards provided the configured delay
is less than 20 minutes. At times under 20 minutes this number is not a
guaranteed minimum spacing - if the new card queue is empty the spaced cards
will be flushed before checking the new queue again, as otherwise we end up
trying to fill on every repetition. The due counts no longer decrease by more
than one if the spacing is less than the due cutoff, since that confused some
users.

Review cards are now placed at the end of the current review queue, and will
never be rescheduled to a different day. The old approach had a number of
problems:

- the more card models you had, the more likely a card would be spaced
  multiple times, resulting in you forgetting the card before you get a chance
  to review it
- spacing was applied even if the due card was already late
- repeatedly failing one card over a period of days or weeks would also stave
  the other cards of attention
2010-12-02 06:33:40 +09:00
Damien Elmes
53fbc9b3ee if spacing is disabled, don't decrement counts 2010-12-01 02:54:21 +09:00
Damien Elmes
bb901dfa16 make sure all fields have a font set 2010-12-01 02:42:13 +09:00
Damien Elmes
9fed5e2bc1 work around sqlalchemy problem 2010-12-01 01:21:05 +09:00
Damien Elmes
ae388595da add whitespace preservation flag; only show active card models when previewing 2010-11-30 03:28:08 +09:00
Damien Elmes
a5af8fb8e9 convert pystache to private library since it doesn't behave like upstream 2010-11-29 22:51:55 +09:00
Damien Elmes
b349a96fa5 drop most of the per-card formatting 2010-11-29 22:27:19 +09:00
Damien Elmes
255deb9e9e elaborate on debug msg 2010-11-28 18:14:09 +09:00
Damien Elmes
850d883ab4 update rest of code to recognize&use new rendering 2010-11-28 02:26:53 +09:00
Damien Elmes
f247133ed8 make syncName work with foreign chars 2010-11-27 13:14:16 +09:00
Damien Elmes
ca9aeaa086 don't allow mature delay over a week for now; fix delay being reset to 0 2010-11-26 23:35:26 +09:00
Damien Elmes
3aa787a146 remove print statement 2010-11-26 03:39:58 +09:00
Damien Elmes
00087ed101 find duplicates support 2010-11-26 03:26:02 +09:00
Damien Elmes
d539018137 support multiple facts in fid: query 2010-11-26 03:25:32 +09:00
Damien Elmes
367143f4f3 make sure to set cards as not due when resetting/rescheduling for old clients 2010-11-26 01:49:10 +09:00
Damien Elmes
dd00d1a5e1 when rebuilding tag priorities, don't include obsolote suspended 2010-11-25 21:56:08 +09:00
Damien Elmes
8f18299cc5 typo 2010-11-24 05:39:06 +09:00
Damien Elmes
f698481c19 don't keep changing the hard interval on load
only adjust it if it looks like the defaults haven't been changed
2010-11-24 05:32:09 +09:00
Damien Elmes
6bdca8b3c6 fix available card limiting when using %(tags)s, %(cardModel), etc 2010-11-24 05:14:07 +09:00
Damien Elmes
7491cfc521 new syncName handling
- the local deck name must now match the online deck
- syncName is a hash of the current deck's path or None
- the hash is checked on deck load, and if it is different (because the deck
  was copied or moved), syncing is disabled. This should prevent people from
  accidentally clobbering their online decks
2010-11-23 23:12:34 +09:00
Damien Elmes
6ec898ca4b Require explicit reset for most queue-modifying functions
When you call operations like deleteCards(), suspendCards() and so on, it is
now necessary to call deck.reset() afterwards. This allows the calling code to
delay a reset if necessary. If the calling code calls a function that says the
caller must reset, the caller should be sure to call .reset() and fetch the
current card again. Failure to do the latter will result in answerCard()
attempting to remove the card from the queue, when the queue has been cleared.
2010-11-23 17:41:36 +09:00
Damien Elmes
943c9a0e5f make sure the finished message displays cards due tomorrow 2010-11-23 15:33:54 +09:00
Damien Elmes
03503cd9b9 fix cram from ids case 2010-11-22 08:09:20 +09:00
Damien Elmes
b03f30c279 no need to adjust hardInterval in upgrade; handled in deck open 2010-11-21 14:24:46 +09:00
Damien Elmes
76135dc8be updated failed card handling when cramming
- temp suspend all answered cards, regardless of type
- fails influence the standard scheduling too
2010-11-21 13:39:28 +09:00
Damien Elmes
937d6a6513 update earliestTime() for new failed cards handling 2010-11-21 12:32:58 +09:00
Damien Elmes
b4493f0ec8 user may set young delay to more than a day 2010-11-21 12:25:54 +09:00
Damien Elmes
c2f2225b7f update combinedDue for the current card object, not just for the db 2010-11-16 11:27:27 +09:00
Damien Elmes
0afec850c0 on second thought, avoid suspended cards or this will bite us in the future 2010-11-15 14:29:52 +09:00
Damien Elmes
1cd5125d4e remove the rest of the obsolote rebuildTypes() code 2010-11-15 14:27:52 +09:00
Damien Elmes
26470c997e remove unused where clause from rebuildTypes() 2010-11-15 14:07:13 +09:00
Damien Elmes
6d2e32e2df finished message should use cutoff + 24hrs 2010-11-14 08:16:07 +09:00
Damien Elmes
6f8a5d6a24 fix wrong priority code in rebuildTypes() 2010-11-14 08:11:28 +09:00
Damien Elmes
1f8adc791a a few failed cards related fixes
- make sure cardLimit() matches on sql statements that are broken over lines
- fix logic in getCardId()
- don't increment failed count if delay1>0 and card was mature
2010-11-13 21:39:52 +09:00
Damien Elmes
7502fba5ce change failed card handling
The old delay1 behaviour isn't easy to achieve with the queue code, as we only
refresh the queue when it's emptied, and if the user has delay1 set to say 9
hours, failed mature cards sitting in the queue could prevent subsequent young
failures from being displayed. Instead we convert delay1 to a count in days in
which to offset failed mature cards. 0 means the same time as delay0, 1 means
show the card a day later, and so on. This means users will lose the ability
to delay mature cards for x number of minutes more than young cards, but a
scan of AnkiOnline decks indicates that's not often done.

We also need to use a separate cutoff for failed cards, since we need to be
able to display them as they expire if the user has disabled per-day
scheduling.

And instead of marking cards as due in the future, we set their due time to
the current time, and move the delay0 calculation to getCardId(). This means
that if the user changes their failed card settings from say 1 hour to 10
minutes, the changes apply to the currently failed cards and not just cards
failed in the future.
2010-11-13 21:15:41 +09:00
Damien Elmes
b69fd48768 more type handling updates; don't munge counts on sync
In various parts of the code we need to get all cards of a given category
(new, failed, etc) regardless of whether they're suspended, buried, etc. So we
store the true type in the obsolete relativeDelay column and add in index for
it, because it's cheaper than putting indices on reps & successive.
2010-11-13 18:39:24 +09:00
Damien Elmes
268d2645fd delete cards that have the wrong card model 2010-11-13 16:33:39 +09:00
Damien Elmes
274017036a add sanity limits to cutoff calculation 2010-11-13 12:00:01 +09:00
Damien Elmes
919353c57d only require due to be past cutoff if the card was passed 2010-11-12 12:51:53 +09:00