fix: No need to get best version when already available locally

This commit is contained in:
Sayantan Santra 2023-08-28 14:14:56 -05:00
parent a215aa6467
commit c770b5f821
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -37,16 +37,6 @@ def apkpure_dl(apk, appname, version, hard_version, session, present_vers, flag)
res.raise_for_status()
soup = bs(res.text, 'html.parser')
if not hard_version:
apkpure_version = apkpure_best_match(version, soup)
if version != apkpure_version:
print(f"Required version {version} not found in APKPure, choosing version {apkpure_version} instead.")
version=apkpure_version
if flag == 'checkonly' and present_vers[apk] != version:
print(f"{apk} has an update ({present_vers[apk]} -> {version})")
return
try:
if present_vers[apk] == version and flag != 'force' and os.path.isfile(apk+'.apk'):
print(
@ -54,6 +44,17 @@ def apkpure_dl(apk, appname, version, hard_version, session, present_vers, flag)
return
except KeyError:
pass
if not hard_version:
apkpure_version = apkpure_best_match(version, soup)
if version not in [apkpure_version, '0']:
print(f"Required version {version} not found in APKPure, choosing version {apkpure_version} instead.")
version=apkpure_version
if flag == 'checkonly' and present_vers[apk] != version:
print(f"{apk} has an update ({present_vers[apk]} -> {version})")
return
print(f" Downloading {apk} version {version}...")
# Get the version code