mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-06-21 22:30:43 -04:00
Precalculate the preferred metadata, rather than always at runtime
The query which dynamically figured out the preferred metadata based on repo priority ended up being quite slow (although it did work). On lower end devices, it has the potential to make F-Droid quite sluggish. By optimistically precalculating the preferred metadata where possible, we don't need to ask the question during the usual usage of F-Droid, only when: * Repo priorities are changed (there is not currently a UI for this, but there are tests) * Repos are enabled/disabled * Repo updates are performed
This commit is contained in:
@@ -371,6 +371,9 @@ public class AppProviderTest extends FDroidProviderTest {
|
||||
Uri uri = AppProvider.getContentUri();
|
||||
|
||||
contentResolver.insert(uri, values);
|
||||
|
||||
AppProvider.Helper.recalculatePreferredMetadata(context);
|
||||
|
||||
return AppProvider.Helper.findSpecificApp(context.getContentResolver(), id, 1, Cols.ALL);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user