fix: Check required version

This commit is contained in:
Sayantan Santra 2023-10-17 23:46:00 -05:00
parent 0a701f4588
commit 8e126d4d45
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -48,7 +48,8 @@ def apkpure_dl(apk, appname, version, hard_version, session, present_vers, flag)
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.")
print(
f"Required version {version} not found in APKPure, choosing version {apkpure_version} instead.")
version = apkpure_version
try:
if present_vers[apk] == version and flag != 'force' and os.path.isfile(apk+'.apk'):
@ -81,7 +82,6 @@ def apkpure_dl(apk, appname, version, hard_version, session, present_vers, flag)
print(" Done!")
# Download apk files, if needed
def get_apks(appstate):
present_vers = appstate['present_vers']
@ -118,7 +118,7 @@ def get_apks(appstate):
print(f"Checking {pretty_name}...")
try:
required_ver = build_config[app]['version']
required_ver[0]
required_ver = Version(required_ver)
hard_version = True
print(f"Using version {required_ver} of {app} from build_config.")
except:
@ -129,7 +129,7 @@ def get_apks(appstate):
if pkg['name'] == apk:
try:
compatible_vers.append(pkg['versions'][-1])
except IndexError:
except TypeError:
pass
if not compatible_vers: