diff --git a/oni-org-roam.el b/oni-org-roam.el index a2feefa..efee57e 100644 --- a/oni-org-roam.el +++ b/oni-org-roam.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2023.0330.183039 +;; Version: 2023.0728.155508 ;; Package-Requires: (oni-org org-roam) ;; This program is free software; you can redistribute it and/or modify @@ -67,13 +67,13 @@ (not (string= state "FINISHED"))))) (defun oni-org-roam--books-to-read () - (seq-filter (lambda (item) - (string= (map-elt (car item) "STATUS") "toread")) - (org-roam-db-query [:select [nodes:properties nodes:file nodes:title] - :from nodes - :left-join tags - :on (= tags:node-id nodes:id) - :where (like tag (quote "%\"book\"%"))]))) + (org-roam-db-query (concat "select properties, file, title, group_concat(tag) as node_tags " + "from nodes " + "left join tags on node_id=id " + "group by id " + "having node_tags like '%%\"book\"%%' " + "and node_tags like '%%\"unread\"%%' " + "order by title"))) (defun oni-org-roam-list-books-to-read () (interactive)