Add UX enhancements: carousel, filter chips, command palette, and more
This commit is contained in:
@@ -255,18 +255,23 @@ fn handle_old_version_cleanup(dialog: &adw::AlertDialog, old_path: PathBuf) {
|
||||
}
|
||||
|
||||
/// Batch check all AppImages for updates. Returns count of updates found.
|
||||
pub fn batch_check_updates(db: &Database) -> u32 {
|
||||
/// Check all apps for updates, returns (count, list of app names with updates).
|
||||
pub fn batch_check_updates_detailed(db: &Database) -> (u32, Vec<String>) {
|
||||
let records = match db.get_all_appimages() {
|
||||
Ok(r) => r,
|
||||
Err(e) => {
|
||||
log::error!("Failed to get appimages for update check: {}", e);
|
||||
return 0;
|
||||
return (0, vec![]);
|
||||
}
|
||||
};
|
||||
|
||||
let mut updates_found = 0u32;
|
||||
let mut updated_names = Vec::new();
|
||||
|
||||
for record in &records {
|
||||
if record.pinned {
|
||||
continue;
|
||||
}
|
||||
let appimage_path = std::path::Path::new(&record.path);
|
||||
if !appimage_path.exists() {
|
||||
continue;
|
||||
@@ -292,6 +297,8 @@ pub fn batch_check_updates(db: &Database) -> u32 {
|
||||
if let Some(ref version) = result.latest_version {
|
||||
db.set_update_available(record.id, Some(version), result.download_url.as_deref()).ok();
|
||||
updates_found += 1;
|
||||
let name = record.app_name.as_deref().unwrap_or(&record.filename);
|
||||
updated_names.push(name.to_string());
|
||||
}
|
||||
} else {
|
||||
db.clear_update_available(record.id).ok();
|
||||
@@ -299,5 +306,9 @@ pub fn batch_check_updates(db: &Database) -> u32 {
|
||||
}
|
||||
}
|
||||
|
||||
updates_found
|
||||
(updates_found, updated_names)
|
||||
}
|
||||
|
||||
pub fn batch_check_updates(db: &Database) -> u32 {
|
||||
batch_check_updates_detailed(db).0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user