Fixed tags with 0 files not being displayed

master
Wynd 2025-05-05 18:14:09 +03:00
parent f0b43360d8
commit f9522d3503
1 changed files with 3 additions and 3 deletions

View File

@ -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<Vec<(String, i32)>> {
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"#,
)?;