- Colonne users.content_preference (anime|serie|both, défaut both) avec migration automatique des bases existantes. - GET /auth/me expose la préférence ; PUT /auth/preferences la met à jour (422 si valeur invalide). - /api/search : filtre les résultats par media_type ET ignore les sources hors périmètre (une source anime-only n'est pas interrogée en mode séries). Les films restent associés aux animés. - /api/discover : nouveautés filtrées selon la même règle. - Sélecteur compact dans la topbar (⛩/📺/✨), persisté serveur. - 7 tests dédiés (roundtrip, rejet invalide, filtrage search/discover, skip de sources) — 114 au total, ruff clean. Prête pour la première source de séries : il ne reste qu'un module SourceScraper avec media_types=("serie",) à écrire.
45 lines
2.3 KiB
HTML
45 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{% block title %}Ohm Stream{% endblock %}</title>
|
|
<link rel="stylesheet" href="/static/css/style.css">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
|
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
|
|
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<header class="topbar" x-data="{ username: '', pref: 'both' }" x-init="fetch('/auth/me').then(r => r.json()).then(u => { username = u.username; pref = u.content_preference || 'both'; }).catch(() => {})">
|
|
<a class="logo" href="/">OHM<span>STREAM</span></a>
|
|
<nav class="topnav">
|
|
<a class="{{ 'active' if active == 'discover' }}" href="/discover">Découvrir</a>
|
|
<a class="{{ 'active' if active == 'search' }}" href="/">Recherche</a>
|
|
<a class="{{ 'active' if active == 'downloads' }}" href="/downloads">Téléchargements</a>
|
|
<a class="{{ 'active' if active == 'library' }}" href="/library">Bibliothèque</a>
|
|
<a class="{{ 'active' if active == 'favorites' }}" href="/favorites">Favoris</a>
|
|
<a class="{{ 'active' if active == 'admin' }}" href="/admin">Admin</a>
|
|
</nav>
|
|
<div class="topbar-right">
|
|
<select class="pref-select" x-model="pref" x-show="username" title="Types de contenus"
|
|
@change="fetch('/auth/preferences', { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ content_preference: pref }) }).then(() => location.reload())">
|
|
<option value="anime">⛩ Animés</option>
|
|
<option value="serie">📺 Séries</option>
|
|
<option value="both">✨ Les deux</option>
|
|
</select>
|
|
<div class="avatar" x-text="username ? username[0] : '·'" :title="username"></div>
|
|
<form method="post" action="/auth/logout" style="display:inline">
|
|
<button class="icon-btn" type="submit" title="Déconnexion">⏻</button>
|
|
</form>
|
|
</div>
|
|
</header>
|
|
<main class="main">
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
<script src="/static/js/app.js"></script>
|
|
<script src="/static/js/update-watcher.js"></script>
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
</html>
|