Add app only downloads APK if needed

This commit is contained in:
Imran Remtulla
2022-11-16 20:57:58 -05:00
parent ba1cdc2c73
commit 618a1523cf
3 changed files with 28 additions and 12 deletions

View File

@@ -163,6 +163,10 @@ class AppSource {
Future<Map<String, String>> search(String query) {
throw NotImplementedError();
}
String? tryGettingAppIdFromURL(String standardUrl) {
return null;
}
}
ObtainiumError getObtainiumHttpError(Response res) {
@@ -240,7 +244,9 @@ class SourceProvider {
APKDetails apk =
await source.getLatestAPKDetails(standardUrl, additionalData);
return App(
id ?? generateTempID(names, source),
id ??
source.tryGettingAppIdFromURL(standardUrl) ??
generateTempID(names, source),
standardUrl,
names.author[0].toUpperCase() + names.author.substring(1),
name.trim().isNotEmpty