Check version pt1

This commit is contained in:
2025-09-18 00:19:13 +03:00
parent 6826e9bedb
commit 76657553e5

View File

@@ -106,25 +106,6 @@ def select_folder():
return folder_path
# [Update Functions] <------------------------------------------------------------------------------------------------------------ [Begin]
def CheckForUpdate(log=False):
print("Connecting....")
print(f"Request Version from API@{TiropitCLI.url}")
response = requests.get(TiropitCLI.url + "/api/getTiropitVersion")
print(f"ResponseCode:{response.status_code}")
print(f"ResponseJSON:{response.json()}")
# [Update Functions] <-------------------------------------------------------------------------------------------------------------- [End]
@@ -181,6 +162,40 @@ def loadConfig():
# [Update Functions] <------------------------------------------------------------------------------------------------------------ [Begin]
def CheckForUpdate(log=False):
print("Connecting....")
print(f"Request Version from API@{TiropitCLI.url}")
response = requests.get(TiropitCLI.url + "/api/getTiropitVersion")
print(f"ResponseCode:{response.status_code}")
data = response.json()
print(f"ResponseJSON:{data}")
version = float(data["Version"])
currentVersion = float(Config.version)
print(f"Recieved Version {version} - Current Version {currentVersion}")
if version > currentVersion:
print(f"Downloading & Installing Update {version}")
# [Update Functions] <-------------------------------------------------------------------------------------------------------------- [End]
def disconnect():
Server.host = "0.0.0.0"