mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
split empty card removal into separate report
This commit is contained in:
parent
fe0e227325
commit
a3407020cb
2 changed files with 14 additions and 6 deletions
|
@ -400,11 +400,20 @@ select id from notes where id in %s and id not in (select nid from cards)""" %
|
|||
ids2str(nids))
|
||||
self._remNotes(nids)
|
||||
|
||||
def remEmptyCards(self, ids):
|
||||
if not ids:
|
||||
return
|
||||
if runFilter("remEmptyCards", True, len(ids)):
|
||||
self.remCards(ids)
|
||||
def emptyCids(self):
|
||||
rem = []
|
||||
for m in self.models.all():
|
||||
rem += self.genCards(self.models.nids(m))
|
||||
return rem
|
||||
|
||||
def emptyCardReport(self, cids):
|
||||
rep = ""
|
||||
for ords, flds in self.db.all("""
|
||||
select group_concat(ord+1), flds from cards c, notes n
|
||||
where c.nid = n.id and c.id in %s group by nid""" % ids2str(cids)):
|
||||
rep += "Cards: %s\nFields: %s\n\n" % (
|
||||
ords, flds.replace("\x1f", " / "))
|
||||
return rep
|
||||
|
||||
# Field checksums and sorting fields
|
||||
##########################################################################
|
||||
|
|
|
@ -362,7 +362,6 @@ select id from notes where mid = ?)""" % " ".join(map),
|
|||
|
||||
def _syncTemplates(self, m):
|
||||
rem = self.col.genCards(self.nids(m))
|
||||
self.col.remEmptyCards(rem)
|
||||
|
||||
# Model changing
|
||||
##########################################################################
|
||||
|
|
Loading…
Reference in a new issue