Improved use of connection observers & fixed a bug in compare versions if it was the same version
This commit is contained in:
parent
1d8c508c52
commit
73c74d339f
2 changed files with 6 additions and 3 deletions
|
|
@ -98,7 +98,8 @@ def setup_singbox_binary(
|
||||||
target_file_hash=target_file_hash,
|
target_file_hash=target_file_hash,
|
||||||
target_app_name="sing-box",
|
target_app_name="sing-box",
|
||||||
target_version=target_version,
|
target_version=target_version,
|
||||||
application_version_observer=application_version_observer
|
application_version_observer=application_version_observer,
|
||||||
|
connection_observer=connection_observer
|
||||||
)
|
)
|
||||||
|
|
||||||
if not file_result.valid:
|
if not file_result.valid:
|
||||||
|
|
@ -254,6 +255,7 @@ def download_and_verify(
|
||||||
target_app_name: str,
|
target_app_name: str,
|
||||||
target_version: str,
|
target_version: str,
|
||||||
application_version_observer: Optional[ApplicationVersionObserver] = None,
|
application_version_observer: Optional[ApplicationVersionObserver] = None,
|
||||||
|
connection_observer: Optional[ConnectionObserver] = None
|
||||||
) -> Result:
|
) -> Result:
|
||||||
"""
|
"""
|
||||||
Purpose:
|
Purpose:
|
||||||
|
|
@ -274,7 +276,8 @@ def download_and_verify(
|
||||||
download_path=download_path,
|
download_path=download_path,
|
||||||
target_file_hash=target_file_hash,
|
target_file_hash=target_file_hash,
|
||||||
application_version_observer=application_version_observer,
|
application_version_observer=application_version_observer,
|
||||||
target_app_version=target_version
|
target_app_version=target_version,
|
||||||
|
connection_observer=connection_observer
|
||||||
)
|
)
|
||||||
|
|
||||||
if not download_result.valid:
|
if not download_result.valid:
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,4 @@ def version_update_required(new_version: str, version_installed: str) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# step 4) if equal, go into the last digit
|
# step 4) if equal, go into the last digit
|
||||||
return new_patch > installed_patch
|
return new_patch >= installed_patch
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue