mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix update urls
This commit is contained in:
parent
e274b0c677
commit
cd3b8d4d9c
@ -20,6 +20,10 @@ class ServerJars:
|
||||
self.base_url = "https://serverjars.com"
|
||||
self.academy = "https://mineacademy.org"
|
||||
|
||||
@staticmethod
|
||||
def get_mineacademy_jars():
|
||||
return MINEACADEMYJARS
|
||||
|
||||
def _get_api_result(self, call_url: str):
|
||||
full_url = f"{self.base_url}{call_url}"
|
||||
|
||||
|
@ -538,10 +538,17 @@ class Controller:
|
||||
# modded update urls from server jars will only update the installer
|
||||
if create_data["category"] != "modded":
|
||||
server_obj = self.servers.get_server_obj(new_server_id)
|
||||
url = (
|
||||
f"https://serverjars.com/api/fetchJar/{create_data['category']}"
|
||||
f"/{create_data['type']}/{create_data['version']}"
|
||||
)
|
||||
if create_data["type"] not in ServerJars.get_mineacademy_jars():
|
||||
url = (
|
||||
"https://serverjars.com/api/fetchJar/"
|
||||
f"{create_data['category']}"
|
||||
f"/{create_data['type']}/{create_data['version']}"
|
||||
)
|
||||
else:
|
||||
url = (
|
||||
"https://mineacademy.org/api/"
|
||||
f"{create_data['type']}/{create_data['version']}"
|
||||
)
|
||||
server_obj.executable_update_url = url
|
||||
self.servers.update_server(server_obj)
|
||||
self.server_jars.download_jar(
|
||||
|
Loading…
Reference in New Issue
Block a user