фикс 11
This commit is contained in:
45
app.py
45
app.py
@@ -116,7 +116,17 @@ BASE_DIR = Path(__file__).resolve().parent
|
|||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
templates = Jinja2Templates(directory=str(BASE_DIR / "templates"))
|
templates = Jinja2Templates(directory=str(BASE_DIR / "templates"))
|
||||||
app.mount("/static", StaticFiles(directory=str(BASE_DIR / "static")), name="static")
|
app.mount("/static", StaticFiles(directory=str(BASE_DIR / "static")), name="static")
|
||||||
run_scheduler()
|
|
||||||
|
@app.on_event("startup")
|
||||||
|
def start_scheduler():
|
||||||
|
import threading
|
||||||
|
|
||||||
|
thread = threading.Thread(
|
||||||
|
target=run_scheduler,
|
||||||
|
daemon=True
|
||||||
|
)
|
||||||
|
thread.start()
|
||||||
|
|
||||||
|
|
||||||
class PublishVmixCommandPayload(BaseModel):
|
class PublishVmixCommandPayload(BaseModel):
|
||||||
match_id: int
|
match_id: int
|
||||||
@@ -488,39 +498,6 @@ def admin_matches(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# @app.get("/admin/matches/{match_id}/select")
|
|
||||||
# def select_match(
|
|
||||||
# request: Request, match_id: int, operator_name: str = Form(default="")
|
|
||||||
# ):
|
|
||||||
# match_row = get_match_by_id(match_id)
|
|
||||||
# if not match_row:
|
|
||||||
# return RedirectResponse(url="/admin/matches", status_code=303)
|
|
||||||
|
|
||||||
# _, match_external_id, _, _, _, _, _ = match_row
|
|
||||||
|
|
||||||
# vmix_result = prepare_vmix_project(match_row)
|
|
||||||
|
|
||||||
# session_row = create_match_session(
|
|
||||||
# match_id=match_id,
|
|
||||||
# operator_name=operator_name.strip() or None,
|
|
||||||
# vmix_project_path=(
|
|
||||||
# vmix_result["project_path"] if vmix_result["success"] else None
|
|
||||||
# ),
|
|
||||||
# )
|
|
||||||
|
|
||||||
# session_token = session_row[3]
|
|
||||||
# log_action(
|
|
||||||
# request,
|
|
||||||
# action="match_selected",
|
|
||||||
# entity_type="match",
|
|
||||||
# entity_id=match_id,
|
|
||||||
# match_id=match_id,
|
|
||||||
# session_token=session_row[3],
|
|
||||||
# details={"operator_name": operator_name.strip() or None},
|
|
||||||
# )
|
|
||||||
# return RedirectResponse(url=f"/admin/session/{session_token}", status_code=303)
|
|
||||||
|
|
||||||
|
|
||||||
@app.get("/admin/matches/{match_id}/select")
|
@app.get("/admin/matches/{match_id}/select")
|
||||||
def select_match(
|
def select_match(
|
||||||
request: Request, match_id: int, operator_name: str = Query(default="")
|
request: Request, match_id: int, operator_name: str = Query(default="")
|
||||||
|
|||||||
Reference in New Issue
Block a user