Fix Ruff warnings

This commit is contained in:
2024-07-26 02:28:05 +02:00
parent ccfa8eb13b
commit b9833c461f
5 changed files with 248 additions and 254 deletions

View File

@ -1,6 +1,7 @@
from __future__ import annotations
from pathlib import Path
from typing import Annotated
from urllib.parse import urljoin
from fastapi import FastAPI, File, Request, UploadFile
@ -20,7 +21,7 @@ app: FastAPI = FastAPI(
@app.post("/uploadfiles/", description="Where to send a POST request to upload files.")
async def upload_file(file: UploadFile = File()): # noqa: B008
async def upload_file(file: Annotated[UploadFile, File()]):
"""Page for uploading files.
If it is a video, we need to make an HTML file, and a thumbnail

View File

@ -32,6 +32,9 @@ def save_to_disk(file: UploadFile) -> VideoFile:
Args:
file: Our uploaded file.
Raises:
ValueError: If the filename is None.
Returns:
VideoFile object with the filename and location.
"""