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