Show update count badge on Updates tab in ViewSwitcherBar

This commit is contained in:
2026-02-28 01:40:22 +02:00
parent 218afbb998
commit 67e5c1ed7a
2 changed files with 26 additions and 0 deletions

View File

@@ -1257,6 +1257,16 @@ impl Database {
Ok(())
}
pub fn updatable_count(&self) -> i64 {
self.conn
.query_row(
"SELECT COUNT(*) FROM appimages WHERE latest_version IS NOT NULL",
[],
|row| row.get(0),
)
.unwrap_or(0)
}
pub fn get_appimages_with_updates(&self) -> SqlResult<Vec<AppImageRecord>> {
let sql = format!(
"SELECT {} FROM appimages WHERE latest_version IS NOT NULL