test3
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from fastapi import FastAPI, HTTPException, Request
|
from fastapi import FastAPI, HTTPException, Request
|
||||||
from fastapi.responses import Response, HTMLResponse, StreamingResponse
|
from fastapi.responses import Response, HTMLResponse, StreamingResponse
|
||||||
|
from fastapi.staticfiles import StaticFiles
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
import requests, uvicorn, json
|
import requests, uvicorn, json
|
||||||
import threading, queue
|
import threading, queue
|
||||||
@@ -1397,7 +1398,8 @@ app = FastAPI(
|
|||||||
redoc_url=None, # ❌ отключает /redoc
|
redoc_url=None, # ❌ отключает /redoc
|
||||||
openapi_url=None, # ❌ отключает /openapi.json
|
openapi_url=None, # ❌ отключает /openapi.json
|
||||||
)
|
)
|
||||||
|
# раздаём /shotmaps как статику из SHOTMAP_DIR
|
||||||
|
app.mount("/shotmaps", StaticFiles(directory=SHOTMAP_DIR), name="shotmaps")
|
||||||
|
|
||||||
def format_time(seconds: float | int) -> str:
|
def format_time(seconds: float | int) -> str:
|
||||||
"""
|
"""
|
||||||
@@ -3459,7 +3461,7 @@ def get_image(points, bib, count_point):
|
|||||||
logger.warning(f"[shotmap] не удалось сохранить {path}: {e}")
|
logger.warning(f"[shotmap] не удалось сохранить {path}: {e}")
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
return f"https://{MYHOST}.tvstart.ru{path}"
|
return f"https://{MYHOST}.tvstart.ru{path.replace('/root/RFB', '')}"
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user