VLC updates, and some infra bugs fix

This commit is contained in:
Timothyxxx
2024-01-09 23:14:06 +08:00
parent 457a0498f2
commit abcafce750
10 changed files with 291 additions and 121 deletions

View File

@@ -199,10 +199,14 @@ class SetupController:
except requests.exceptions.RequestException as e:
logger.error("An error occurred while trying to send the request: %s", e)
def _launch_setup(self, command: List[str]):
def _launch_setup(self, command: Union[str, List[str]]):
if not command:
raise Exception("Empty command to launch.")
if isinstance(command, str) and len(command.split()) > 1:
logger.warning("Command should be a list of strings. Now it is a string. Will split it by space.")
command = command.split()
payload = json.dumps({"command": command})
headers = {"Content-Type": "application/json"}