Commit graph

520 commits

Author SHA1 Message Date
Damien Elmes
b235461d8b space cards to next session if per-day off 2011-01-02 17:43:53 +09:00
Damien Elmes
329ab99ff7 add seen card count back for plugins 2011-01-02 13:05:18 +09:00
Damien Elmes
ece9b2eccd don't limit failed cards to 0 when cramming 2010-12-27 21:39:20 +09:00
Damien Elmes
a2606dd70a remove some unused calls 2010-12-26 07:35:20 +09:00
Damien Elmes
9890c77514 update finished screen to use blanket inactive/suspended msg 2010-12-26 07:29:31 +09:00
Damien Elmes
856839e055 include reviews in spaced card count; bold text 2010-12-26 06:01:24 +09:00
Damien Elmes
63106578cd don't decrement due counts when spacing
This works fine if the user is showing all cards, but if they have limited
reviews to certain categories, it can result in the counts going negative
because we decremented for cards which weren't actually due. Determining if a
card was actually due or not is an expensive operation, so instead we leave
the counts alone and make sure reviews will finish early if the new/rev counts
are non-zero but the queue is empty.
2010-12-26 05:54:05 +09:00
Damien Elmes
61812b173d mention syncing disabled case 2010-12-21 23:58:36 +09:00
Damien Elmes
ca07cb8f26 don't dump upgrade notices on stderr if not attached to gui 2010-12-17 04:27:12 +09:00
Damien Elmes
6860f64f28 try to recover tags of card, too 2010-12-17 02:03:35 +09:00
Damien Elmes
5eb00296d5 always space rev cards to the next day 2010-12-17 01:46:14 +09:00
Damien Elmes
7065abcf4f only collapse failed cards after cutoff updated 2010-12-16 22:23:51 +09:00
Damien Elmes
e4447818ff make sure learn more considers inactive cards 2010-12-16 04:28:31 +09:00
Damien Elmes
907fa5c80e tweak spaceCards() 2010-12-15 04:46:40 +09:00
Damien Elmes
0363cc70f4 preserve more of the old formatting on upgrade
because field formatting is always on now, users with custom font
sizes/families set only on the card will still have to alter their templates
and either configure the fields or replace the references with triple
curly braces
2010-12-15 03:52:18 +09:00
Damien Elmes
09b017bb24 not sorting on combinedDue anymore, so don't bother with that upgrade step 2010-12-15 02:03:12 +09:00
Damien Elmes
7ce661ac63 place cards with corrupt/missing facts into new fact instead of deleting 2010-12-13 06:46:20 +09:00
Damien Elmes
0a01d9f867 make latex preamble easier to read 2010-12-13 03:21:05 +09:00
Damien Elmes
d0c6db0d62 only regenerate indices once during upgrade from 1.0 2010-12-13 02:29:21 +09:00
Damien Elmes
d14761b428 sort new cards by due not combinedDue; index optimizations
- ensure queue filling selects can be satisfied by index alone
- sort by due instead of combinedDue so we can decouple card order from
  new spacing
2010-12-13 02:25:39 +09:00
Damien Elmes
5de6bb57ed auto-analyze when we've updated a dynamic index 2010-12-13 00:26:34 +09:00
Damien Elmes
cc8dbccf38 don't set combinedDue twice in answerCard 2010-12-12 00:09:40 +09:00
Damien Elmes
7ab5a53e38 remove superfluous 0 2010-12-11 17:02:51 +09:00
Damien Elmes
35fd3de6fb reset if there were buried cards, since updatePriorities() doesn't 2010-12-11 15:55:22 +09:00
Damien Elmes
f42a2e4a00 rebuild q/a cache to include latex 2010-12-11 02:17:00 +09:00
Damien Elmes
70eb44bce2 latex improvements
- move latex preamble into a deck var and include amsmath by default
- include the pre/postamble in the hash, so changes to the preamble result in
  newly generated images
2010-12-11 02:05:00 +09:00
Damien Elmes
4d2d9eab81 generate latex at fact modification, not review
- latex now slots in to the formatQA hook to render images in the q/a
- moved call() to utils
- cache/uncache latex have been obsoleted. User can delete manually, and
  images will be regenerated with a DB check
2010-12-11 01:40:49 +09:00
Damien Elmes
0c9672e7b8 rewrite media support
- media is no longer hashed, and instead stored in the db using its original
  name
- when adding media, its checksum is calculated and used to look for
  duplicates
- duplicate filenames will result in a number tacked on the file
- the size column is used to count card references to media. If media is
  referenced in a fact but not the question or answer, the count will be zero.
- there is no guarantee media will be listed in the media db if it is unused
  on the question & answer
- if rebuildMediaDir(delete=True), then entries with zero references are
  deleted, along with any unused files in the media dir.
- rebuildMediaDir() will update the internal checksums, and set the checksum
  to "" if a file can't be found
- rebuildMediaDir() is a lot less destructive now, and will leave alone
  directories it finds in the media folder (but not look in them either)
- rebuildMediaDir() returns more information about the state of media now
- the online and mobile clients will need to to make sure that when
  downloading media, entries with no checksum are non-fatal and should not
  abort the download process.
- the ref count is updated every time the q/a is updated - so the db should be
  up to date after every add/edit/import
- since we look for media on the q/a now, card templates like '<img
  src="{{{field}}}">' will work now
- export original files as gone as it is not needed anymore
- move from per-model media URL to deckVar. downloadMissingMedia() uses this
  now. Deck subscriptions will have to be updated to share media another way.
- pass deck in formatQA, as latex support is going to change
2010-12-11 01:19:31 +09:00
Damien Elmes
27ca04fab6 support a media prefix 2010-12-09 15:34:01 +09:00
Damien Elmes
84a98550f0 always change cwd to media dir 2010-12-09 12:55:00 +09:00
Damien Elmes
1bbffec0d6 abort download missing media early; remove obsolete forceMediaDir 2010-12-09 12:53:01 +09:00
Damien Elmes
e5d9697d28 don't break older clients with new delay1 setting 2010-12-09 12:00:00 +09:00
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