iens

Manager of links to read
git clone https://git.instinctive.eu/iens.git
Log | Files | Refs | README | LICENSE

commit 000825fda10c31480e2751c793fd0c56fee095df
parent af37f4bc9718f971360270a2fa533671e11446c7
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date:   Tue,  2 Jan 2024 11:39:53 +0000

Tag list also displays respective entry counts
Diffstat:
Msrc/iens.scm | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/iens.scm b/src/iens.scm @@ -204,7 +204,7 @@ (define add-tag-stmt (sql db "INSERT INTO tag(name) VALUES (?);")) (define list-tags-stmt - (sql db "SELECT name, auto FROM tag ORDER BY name;")) + (sql db "SELECT name,auto,COUNT(tagrel.url_id) FROM tag OUTER LEFT JOIN tagrel ON id = tagrel.tag_id GROUP BY id ORDER BY name;")) (define remove-tag-stmt (sql db "DELETE FROM tag WHERE name = ?;")) (define rename-tag-stmt @@ -243,8 +243,8 @@ "" "List available tag, automatic tags are marked with *" (query (for-each-row* - (lambda (name auto) - (write-line (conc " " name (if (= 0 auto) "" "*"))))) + (lambda (name auto count) + (write-line (conc " " name (if (= 0 auto) " (" "* (") count ")")))) list-tags-stmt)) (defcmd (remove-auto-tag name . rest)