URL selection modal improvements (incl. #460)

This commit is contained in:
Imran Remtulla
2023-04-22 23:49:55 -04:00
parent be61220af4
commit de2b7fa7a1
3 changed files with 62 additions and 25 deletions

View File

@@ -519,11 +519,14 @@ class SourceProvider {
// Returns errors in [results, errors] instead of throwing them
Future<List<dynamic>> getAppsByURLNaive(List<String> urls,
{List<String> ignoreUrls = const []}) async {
{List<String> alreadyAddedUrls = const []}) async {
List<App> apps = [];
Map<String, dynamic> errors = {};
for (var url in urls.where((element) => !ignoreUrls.contains(element))) {
for (var url in urls) {
try {
if (alreadyAddedUrls.contains(url)) {
throw ObtainiumError(tr('appAlreadyAdded'));
}
var source = getSource(url);
apps.add(await getApp(
source,