diff --git a/CLI/Init.py b/CLI/Init.py index 64172f7..b60c60f 100644 --- a/CLI/Init.py +++ b/CLI/Init.py @@ -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"