feat: fix auth, provider health checks, search, and redesign UI
- Fix register/login: dict-style access on UserTable ORM objects - Fix HTMX auth: inject JWT token in all HTMX request headers - Fix FS7 search: use DLE AJAX endpoint /engine/ajax/search.php - Fix ZT search: use ?p=series&search=QUERY (not DLE format) - Fix provider health: load hardcoded providers + domain manager - Add self.id to all anime/series providers - Redesign homepage: Netflix-style horizontal scroll cards (.hc) - Redesign search results: grouped by title, poster + synopsis + 3 buttons - Add Télécharger dropdown: season download + episode picker - Fix navbar CSS: restore .tabs flex layout, remove orphan rules - Fix HTMX spinner: remove inline display:none, use CSS indicator - Add AGENTS.md files across project for developer documentation
This commit is contained in:
@@ -10,7 +10,7 @@ import uuid
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi import FastAPI, Request, Response
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.templating import Jinja2Templates
|
||||
@@ -21,10 +21,18 @@ from app.models import DownloadTask, DownloadStatus
|
||||
# Configure logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
PERMISSIONS_POLICY_VALUE = (
|
||||
"accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), "
|
||||
"camera=(), display-capture=(), document-domain=(), encrypted-media=(), "
|
||||
"fullscreen=*, gamepad=(), geolocation=(), gyroscope=(), "
|
||||
"magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=*, "
|
||||
"publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), "
|
||||
"usb=(), web-share=(), xr-spatial-tracking=()"
|
||||
)
|
||||
|
||||
# Initialize FastAPI app
|
||||
app = FastAPI(title="Ohm Stream Downloader")
|
||||
|
||||
# Configure CORS
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=[
|
||||
@@ -40,6 +48,14 @@ app.add_middleware(
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
@app.middleware("http")
|
||||
async def permissions_policy_middleware(request: Request, call_next):
|
||||
response: Response = await call_next(request)
|
||||
response.headers["Permissions-Policy"] = PERMISSIONS_POLICY_VALUE
|
||||
return response
|
||||
|
||||
|
||||
# Initialize download manager
|
||||
download_manager = DownloadManager(download_dir="downloads", max_parallel=3)
|
||||
|
||||
@@ -54,6 +70,7 @@ async def startup_event():
|
||||
"""Initialize services on application startup"""
|
||||
# Create database tables if they don't exist
|
||||
from app.database import create_db_and_tables
|
||||
|
||||
create_db_and_tables()
|
||||
logger.info("Database tables initialized")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user