From ed905a327842b2d4fd2fb5a3c652f4b24b47d81a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 10:26:48 +0000 Subject: [PATCH] Notes par saison : note + avis par saison, note finale = moyenne arrondie MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Section « Mes saisons » dans la fiche d'une série (≥ 2 saisons) : une note et un avis (avec spoiler) par saison. - Quand la série est terminée, la note finale = moyenne des saisons notées, arrondie (étoiles et /10). - Les séries déjà notées sans notes de saison restent intactes. - Un +1 qui termine une saison ouvre la fiche sur cette saison à noter ; « Reprendre » passe à S02 É01. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe --- src/App.tsx | 7 +- src/components/HomeHero.tsx | 10 +- src/components/title/SeasonRatings.tsx | 182 +++++++++++++++++++++++++ src/components/title/TitleSheet.tsx | 33 ++++- src/i18n/locales/ar.ts | 13 ++ src/i18n/locales/de.ts | 13 ++ src/i18n/locales/en.ts | 13 ++ src/i18n/locales/es.ts | 13 ++ src/i18n/locales/fr.ts | 13 ++ src/i18n/locales/hi.ts | 13 ++ src/i18n/locales/id.ts | 13 ++ src/i18n/locales/it.ts | 13 ++ src/i18n/locales/ja.ts | 13 ++ src/i18n/locales/ko.ts | 13 ++ src/i18n/locales/nl.ts | 13 ++ src/i18n/locales/pl.ts | 13 ++ src/i18n/locales/pt.ts | 13 ++ src/i18n/locales/ru.ts | 13 ++ src/i18n/locales/th.ts | 13 ++ src/i18n/locales/tr.ts | 13 ++ src/i18n/locales/vi.ts | 13 ++ src/i18n/locales/zh.ts | 13 ++ src/lib/backup.ts | 2 + src/lib/seasons.ts | 59 ++++++++ src/store.tsx | 15 +- src/types.ts | 9 ++ 26 files changed, 540 insertions(+), 11 deletions(-) create mode 100644 src/components/title/SeasonRatings.tsx create mode 100644 src/lib/seasons.ts diff --git a/src/App.tsx b/src/App.tsx index 6d07a8e..9339ebb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -20,6 +20,7 @@ import SyncIndicator from './components/SyncIndicator' import { useMedia } from './store' import type { SearchResult } from './lib/catalogApi' import type { MediaItem } from './types' +import type { Completion } from './lib/seasons' const TABS: Tab[] = ['home', 'catalog', 'stats', 'settings'] // L'administration a sa propre route (#/admin), hors de la navigation principale @@ -40,7 +41,7 @@ function routeFromHash(): Route { * ou page d'une personne. Titre → acteur → autre titre → … : « retour » remonte d'un cran. */ type Layer = - | { kind: 'title'; item: MediaItem; seed?: undefined } + | { kind: 'title'; item: MediaItem; seed?: undefined; focus?: Completion } | { kind: 'title'; seed: SearchResult; item?: undefined } | { kind: 'person'; personId: string; name?: string; photo?: string } let layerUid = 0 @@ -69,7 +70,8 @@ export default function App() { // Dans la barre de navigation, l'administration reste rattachée à « Réglages » const navTab: Tab = route === 'admin' ? 'settings' : route === 'notfound' ? 'home' : route - const openItem = (item: MediaItem) => pushLayer({ kind: 'title', item }) + /** `focus` : saison (ou série) qu'on vient de finir avec +1 → la fiche s'ouvre sur la note */ + const openItem = (item: MediaItem, focus?: Completion) => pushLayer({ kind: 'title', item, focus }) const openSeed = (seed: SearchResult) => pushLayer({ kind: 'title', seed }) const openPerson = (p: { id: string; name?: string; photo?: string }) => pushLayer({ kind: 'person', personId: p.id, name: p.name, photo: p.photo }) const openNew = () => setAdding(true) @@ -122,6 +124,7 @@ export default function App() { onClose={() => closeLayer(l.uid)} onGoToSettings={toSettings} onOpenPerson={openPerson} + focus={l.item ? l.focus : undefined} /> ) : ( void }) { +export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen: (item: MediaItem, focus?: Completion) => void }) { const { incrementEpisode } = useMedia() // On retient le titre affiché (et pas sa position) : la liste se réordonne quand on avance un épisode const [currentId, setCurrentId] = useState() @@ -106,7 +107,8 @@ export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen {next && (