diff --git a/anki/collection.py b/anki/collection.py index 6e96637f7..e2e00b5fa 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -259,7 +259,7 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""", strids = ids2str(ids) # we need to log these independently of cards, as one side may have # more card templates - runHook("remNotes", ids) + runHook("remNotes", self, ids) self._logRem(ids, REM_NOTE) self.db.execute("delete from notes where id in %s" % strids) diff --git a/aqt/main.py b/aqt/main.py index 380012064..c5781f809 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -833,13 +833,13 @@ the problem and restart Anki.""") # Log note deletion ########################################################################## - def onRemNotes(self, nids): + def onRemNotes(self, col, nids): path = os.path.join(self.pm.profileFolder(), "deleted.txt") existed = os.path.exists(path) with open(path, "a") as f: if not existed: f.write("nid\tmid\tfields\n") - for id, mid, flds in self.col.db.execute( + for id, mid, flds in col.db.execute( "select id, mid, flds from notes where id in %s" % ids2str(nids)): fields = splitFields(flds)