Improvement on previous commit

This commit is contained in:
Imran Remtulla
2024-08-05 16:08:12 -04:00
parent 71cc49a30f
commit fd38444836

View File

@@ -82,8 +82,8 @@ class APKPure extends AppSource {
throw NoReleasesError();
}
List<APKDetails?> versionDetails =
(await Future.wait(versionLinks.map((link) async {
for (var i = 0; i < versionLinks.length; i++) {
var link = versionLinks[i];
var res = await sourceRequest(link.key, additionalSettings);
if (res.statusCode == 200) {
var html = parse(res.body);
@@ -129,7 +129,7 @@ class APKPure extends AppSource {
.toList() ??
[];
if (apkUrls.isEmpty) {
return null;
continue;
}
String version = Uri.parse(link.key).pathSegments.last;
String author = html
@@ -150,12 +150,7 @@ class APKPure extends AppSource {
} else {
throw getObtainiumHttpError(res);
}
})))
.where((e) => e != null)
.toList();
if (versionDetails.isEmpty) {
throw NoAPKError();
}
return versionDetails[0]!;
throw NoAPKError();
}
}