mirror of
https://github.com/StepanovPlaton/torrent_backend.git
synced 2026-04-03 20:30:38 +04:00
Add file upload
This commit is contained in:
16
routes/startup.py
Normal file
16
routes/startup.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from fastapi import APIRouter
|
||||
from pathlib import Path
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.on_event("startup")
|
||||
def startup():
|
||||
need_paths = [
|
||||
Path() / "content" / "images" / "cover" / "full_size",
|
||||
Path() / "content" / "images" / "cover" / "preview",
|
||||
Path() / "content" / "images" / "screenshot" / "full_size",
|
||||
Path() / "content" / "images" / "screenshot" / "preview",
|
||||
Path() / "content" / "torrent"
|
||||
]
|
||||
for path in need_paths:
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
Reference in New Issue
Block a user