diff --git a/anki/collection.py b/anki/collection.py index 4e4c20f35..8e9335eae 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -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 ########################################################################## diff --git a/anki/models.py b/anki/models.py index 528b9b602..9d99726d4 100644 --- a/anki/models.py +++ b/anki/models.py @@ -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 ##########################################################################