From f9522d350335339d8007b046f8a3c7877d00e895 Mon Sep 17 00:00:00 2001 From: Wynd Date: Mon, 5 May 2025 18:14:09 +0300 Subject: [PATCH] Fixed tags with 0 files not being displayed --- src/tags.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tags.rs b/src/tags.rs index c15a665..5cb89fa 100644 --- a/src/tags.rs +++ b/src/tags.rs @@ -1,7 +1,7 @@ use std::{ fs, io::{self, Write}, - path::{self, PathBuf}, + path::PathBuf, str::FromStr, }; @@ -144,8 +144,8 @@ fn rename_tag(conn: &Connection, old: String, new: String) -> Result<()> { fn list_tags(conn: &Connection) -> Result> { let mut stmt = conn.prepare( - r#"SELECT name, COUNT() as count FROM tag - INNER JOIN file_tag ON file_tag.tag_id = tag.id + r#"SELECT name, COUNT(file_id) as count FROM tag + LEFT JOIN file_tag ON file_tag.tag_id = tag.id GROUP BY name ORDER BY count DESC"#, )?;