diff options
author | Thanos Apollo <[email protected]> | 2024-03-03 02:27:07 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-03-03 02:27:35 +0200 |
commit | cb391c6e86a17270ccb9735b8b1b91a7d0669c70 (patch) | |
tree | cbe09a58f50bcb4b7398dd9b16995ead035a304e /gnosis.el | |
parent | 70aac53df16e3cf4321f68ebe8e1fcded4abf4c3 (diff) |
Add gnosis-dashboard-deck-note-count
Return total deck note count in a list. Will be used to output decks.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) |