Add GitHub metadata enrichment for catalog apps

Enrich catalog apps with GitHub API data (stars, version, downloads,
release date) via two strategies: background drip for repo-level info
and on-demand fetch when opening a detail page.

- Add github_enrichment module with API calls, asset filtering, and
  architecture auto-detection for AppImage downloads
- DB migrations v14/v15 for GitHub metadata and release asset columns
- Extract github_owner/repo from feed links during catalog sync
- Display colored stat cards (stars, version, downloads, released) on
  detail pages with on-demand enrichment
- Show stars and version on browse tiles and featured carousel cards
- Replace install button with SplitButton dropdown when multiple arch
  assets available, preferring detected architecture
- Disable install button until enrichment completes to prevent stale
  AppImageHub URL downloads
- Keep enrichment banner visible on catalog page until truly complete,
  showing paused state when rate-limited
- Add GitHub token and auto-enrich toggle to preferences
This commit is contained in:
lashman
2026-02-28 16:49:13 +02:00
parent 92c51dc39e
commit f89aafca6a
15 changed files with 3027 additions and 224 deletions

View File

@@ -413,6 +413,44 @@ fn build_updates_page(settings: &gio::Settings) -> adw::PreferencesPage {
page.add(&security_group);
// Catalog Enrichment group
let enrichment_group = adw::PreferencesGroup::builder()
.title(&i18n("Catalog Enrichment"))
.description(&i18n("Fetch GitHub metadata (stars, version, downloads) for catalog apps"))
.build();
let auto_enrich_row = adw::SwitchRow::builder()
.title(&i18n("Auto-enrich catalog apps"))
.subtitle(&i18n("Fetch metadata from GitHub in the background"))
.active(settings.boolean("catalog-auto-enrich"))
.build();
let settings_enrich = settings.clone();
auto_enrich_row.connect_active_notify(move |row| {
settings_enrich.set_boolean("catalog-auto-enrich", row.is_active()).ok();
});
enrichment_group.add(&auto_enrich_row);
let token_row = adw::PasswordEntryRow::builder()
.title(&i18n("GitHub token"))
.build();
let current_token = settings.string("github-token");
if !current_token.is_empty() {
token_row.set_text(&current_token);
}
let settings_token = settings.clone();
token_row.connect_changed(move |row| {
settings_token.set_string("github-token", &row.text()).ok();
});
enrichment_group.add(&token_row);
let token_hint = adw::ActionRow::builder()
.title(&i18n("Optional - increases rate limit from 60 to 5,000 requests per hour"))
.css_classes(["dim-label"])
.build();
enrichment_group.add(&token_hint);
page.add(&enrichment_group);
page
}