Skip to content

Commit

Permalink
Preprocess metadata on FlatpakBackend constructor if no cache folders…
Browse files Browse the repository at this point in the history
… are available. (#2249)
  • Loading branch information
edwood-grant authored Feb 18, 2025
1 parent 55f51a7 commit 57127a4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Core/FlatpakBackend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,29 @@ public class AppCenterCore.FlatpakBackend : Object {
"system"
);

GLib.GenericArray<weak Flatpak.Remote> remotes = null;
var user_file = File.new_for_path (user_metadata_path);
if (user_installation != null && !user_file.query_exists ()) {
try {
user_installation.drop_caches ();
remotes = user_installation.list_remotes ();
preprocess_metadata (false, remotes, null);
} catch (Error e) {
critical ("Error getting user flatpak remotes: %s", e.message);
}
}

var system_file = File.new_for_path (system_metadata_path);
if (system_installation != null && !system_file.query_exists ()) {
try {
system_installation.drop_caches ();
remotes = system_installation.list_remotes ();
preprocess_metadata (true, remotes, null);
} catch (Error e) {
warning ("Error getting system flatpak remotes: %s", e.message);
}
}

reload_appstream_pool ();
}

Expand Down

0 comments on commit 57127a4

Please sign in to comment.