Working zip imports

This commit is contained in:
amcmanu3 2022-08-17 18:14:16 -04:00
parent b5420c083e
commit 504ffd57f6
3 changed files with 7 additions and 3 deletions

View File

@ -31,9 +31,11 @@ class FileHelpers:
sub.unlink()
except:
logger.error(f"Unable to delete file {sub}")
# This removes the top-level folder:
path.rmdir()
try:
# This removes the top-level folder:
path.rmdir()
except:
logger.error("Unable to remove top level")
return True
@staticmethod

View File

@ -106,5 +106,6 @@ class ImportHelpers:
file.close()
server_users = PermissionsServers.get_server_user_list(new_id)
ServersController.finish_import(new_id)
for user in server_users:
self.helper.websocket_helper.broadcast_user(user, "send_start_reload", {})

View File

@ -627,6 +627,7 @@ class Controller:
port,
server_type="minecraft-java",
)
ServersController.set_import(new_id)
self.import_helper.import_java_zip_server(
temp_dir, new_server_dir, port, new_id
)