summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index d973d64..1832b7e 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1544,6 +1544,11 @@ name and all notes formatted as nested lists"
(gnosis-dashboard-output-notes)
(revert-buffer t t t)))))
+(defun gnosis-dashboard-deck-note-count (id)
+ "Return total note count for deck with ID."
+ (let ((note-count (caar (emacsql gnosis-db (format "SELECT COUNT(*) FROM notes WHERE deck_id=%s" id)))))
+ (when (gnosis-select 'id 'decks `(= id ,id))
+ (list (number-to-string note-count)))))
(defun gnosis-dashboard-edit-note ()
"Get note id from tabulated list and edit it."
(interactive)