mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-30 21:13:28 +01:00 
			
		
		
		
	Fix broken search (#1006)
This commit is contained in:
		| @@ -8,6 +8,7 @@ class FDroidRepo extends AppSource { | ||||
|   FDroidRepo() { | ||||
|     name = tr('fdroidThirdPartyRepo'); | ||||
|     canSearch = true; | ||||
|     excludeFromMassSearch = true; | ||||
|     neverAutoSelect = true; | ||||
|  | ||||
|     additionalSourceAppSpecificSettingFormItems = [ | ||||
|   | ||||
| @@ -153,8 +153,7 @@ class _AddAppPageState extends State<AddAppPage> { | ||||
|               overrideSource: pickedSourceOverride, | ||||
|               inferAppIdIfOptional: inferAppIdIfOptional); | ||||
|           // Only download the APK here if you need to for the package ID | ||||
|           if (isTempId(app) && | ||||
|               app.additionalSettings['trackOnly'] != true) { | ||||
|           if (isTempId(app) && app.additionalSettings['trackOnly'] != true) { | ||||
|             // ignore: use_build_context_synchronously | ||||
|             var apkUrl = await appsProvider.confirmApkUrl(app, context); | ||||
|             if (apkUrl == null) { | ||||
| @@ -260,8 +259,9 @@ class _AddAppPageState extends State<AddAppPage> { | ||||
|         searching = true; | ||||
|       }); | ||||
|       try { | ||||
|         var results = await Future.wait( | ||||
|             sourceProvider.sources.where((e) => e.canSearch).map((e) async { | ||||
|         var results = await Future.wait(sourceProvider.sources | ||||
|             .where((e) => e.canSearch && !e.excludeFromMassSearch) | ||||
|             .map((e) async { | ||||
|           try { | ||||
|             return await e.search(searchQuery); | ||||
|           } catch (err) { | ||||
|   | ||||
| @@ -141,7 +141,8 @@ class _ImportExportPageState extends State<ImportExportPage> { | ||||
|               } | ||||
|             }); | ||||
|             appsProvider.addMissingCategories(settingsProvider); | ||||
|             showMessage(tr('importedX', args: [plural('apps', value)]), context); | ||||
|             showMessage( | ||||
|                 tr('importedX', args: [plural('apps', value)]), context); | ||||
|           }); | ||||
|         } else { | ||||
|           // User canceled the picker | ||||
|   | ||||
| @@ -494,6 +494,7 @@ abstract class AppSource { | ||||
|   } | ||||
|  | ||||
|   bool canSearch = false; | ||||
|   bool excludeFromMassSearch = false; | ||||
|   List<GeneratedFormItem> searchQuerySettingFormItems = []; | ||||
|   Future<Map<String, List<String>>> search(String query, | ||||
|       {Map<String, dynamic> querySettings = const {}}) { | ||||
| @@ -605,7 +606,8 @@ class SourceProvider { | ||||
|       } | ||||
|     } | ||||
|     if (source == null) { | ||||
|       for (var s in sources.where((element) => element.host == null && !element.neverAutoSelect)) { | ||||
|       for (var s in sources.where( | ||||
|           (element) => element.host == null && !element.neverAutoSelect)) { | ||||
|         try { | ||||
|           s.sourceSpecificStandardizeURL(url); | ||||
|           source = s; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user