mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
need to order cards after import for sibling spacing (#464)
This commit is contained in:
parent
41d7f716bb
commit
d72fb35825
2 changed files with 11 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import cgi
|
import cgi
|
||||||
|
from anki.consts import NEW_CARDS_RANDOM
|
||||||
from anki.lang import _
|
from anki.lang import _
|
||||||
from anki.utils import fieldChecksum, guid64, timestampID, \
|
from anki.utils import fieldChecksum, guid64, timestampID, \
|
||||||
joinFields, intTime, splitFields
|
joinFields, intTime, splitFields
|
||||||
|
@ -173,7 +174,15 @@ class NoteImporter(Importer):
|
||||||
"Empty cards found. Please run Tools>Empty Cards."))
|
"Empty cards found. Please run Tools>Empty Cards."))
|
||||||
# apply scheduling updates
|
# apply scheduling updates
|
||||||
self.updateCards()
|
self.updateCards()
|
||||||
self.col.sched.maybeRandomizeDeck()
|
# we randomize or order here, to ensure that siblings
|
||||||
|
# have the same due#
|
||||||
|
did = self.col.decks.selected()
|
||||||
|
conf = self.col.decks.confForDid(did)
|
||||||
|
# in order due?
|
||||||
|
if conf['new']['order'] == NEW_CARDS_RANDOM:
|
||||||
|
self.col.sched.randomizeCards(did)
|
||||||
|
else:
|
||||||
|
self.col.sched.orderCards(did)
|
||||||
part1 = ngettext("%d note added", "%d notes added", len(new)) % len(new)
|
part1 = ngettext("%d note added", "%d notes added", len(new)) % len(new)
|
||||||
part2 = ngettext("%d note updated", "%d notes updated", self.updateCount) % self.updateCount
|
part2 = ngettext("%d note updated", "%d notes updated", self.updateCount) % self.updateCount
|
||||||
self.log.append("%s, %s." % (part1, part2))
|
self.log.append("%s, %s." % (part1, part2))
|
||||||
|
|
|
@ -1359,4 +1359,4 @@ and due >= ? and queue = 0""" % scids, now, self.col.usn(), shiftby, low)
|
||||||
conf = self.col.decks.confForDid(did)
|
conf = self.col.decks.confForDid(did)
|
||||||
# in order due?
|
# in order due?
|
||||||
if conf['new']['order'] == NEW_CARDS_RANDOM:
|
if conf['new']['order'] == NEW_CARDS_RANDOM:
|
||||||
self.col.sched.randomizeCards(did)
|
self.randomizeCards(did)
|
||||||
|
|
Loading…
Reference in a new issue