diff --git a/app/routers/router_anime.py b/app/routers/router_anime.py index 340b7e7..bd24813 100644 --- a/app/routers/router_anime.py +++ b/app/routers/router_anime.py @@ -65,11 +65,12 @@ async def search_anime_unified( q: str, lang: str = "vostfr", include_metadata: bool = False, + html: bool = Query(False), ): """ Search across all anime providers using MetadataEnricher and health checks. Results are grouped by provider for legacy UI compatibility. - Returns HTML for HTMX requests. + Returns HTML for HTMX requests or if html=True parameter is set. """ print(f"\n[SEARCH] Starting modern unified search for '{q}' in {lang}") start_time = time.time() @@ -103,7 +104,7 @@ async def search_anime_unified( seen_urls = set() enricher = await get_metadata_enricher() enrichment_tasks = [] - enrichment_mapping = [] # List of (provider_id, index_in_provider_results) + enrichment_mapping = [] for i, raw_result in enumerate(all_raw_results): provider_info = task_metadata[i] @@ -172,7 +173,7 @@ async def search_anime_unified( print(f"[SEARCH] Finished in {elapsed:.2f}s. Found {total_found} unique results across {len(results)} providers.") # 6. Return HTML for HTMX or JSON for API - if request.headers.get("HX-Request"): + if html or request.headers.get("HX-Request"): return templates.TemplateResponse( "components/anime_search_results.html", {"request": request, "results": results} @@ -351,6 +352,7 @@ async def search_anime_mal_details( await fetcher.close() +@router.post("/api/translate") @router.post("/translate") async def translate_text(request: Request): """Translate text from English to French using Google Translate""" diff --git a/static/css/style.css b/static/css/style.css index dbb8290..06f36bc 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -172,11 +172,7 @@ } .tab-content { - /* Managed by Alpine.js x-show */ - } - - .tab-content.active { - display: block; + /* Handled by Alpine.js x-show */ } select { diff --git a/templates/index.html b/templates/index.html index 6b6be5a..54e8460 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,7 +3,7 @@ {% block content %} {% include "components/header.html" %} - +
{% include "components/home_section.html" %} @@ -15,7 +15,7 @@

🎬 Rechercher un Anime

-
@@ -43,6 +43,9 @@
+ + +