Revisionnage : revoir un film ou une série déjà terminés

- Bloc « Revoir » sur la fiche d'un titre terminé, avec le nombre de visionnages (« Vu 3 fois »).
- Film : « Revu le … » à la date choisie (aujourd'hui par défaut), annulable.
- Série : « Commencer un revisionnage » avec sa propre progression d'épisodes
  (Reprendre, +1, liste d'épisodes), badge « Revisionnage » sur l'accueil.
  Le premier visionnage reste intact (statut, dates, note, notes de saison).
  Au dernier épisode, le revisionnage se termine et rejoint l'historique ;
  on peut aussi le terminer d'un coup ou l'arrêter.
- Les épisodes revus comptent pour les défis ; le temps des revisionnages de séries
  compte dans les stats et le journal.
- Données dans la fiche (champ rewatch), synchronisées et sauvegardées, rien côté SQL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
Claude committed 2026-10-18 18:04:38 +00:00
1 parent e1cd166366
commit 1433fc627c
29 files changed
+644 -39

No files matched your search

+24 -6
View File
@@ -9,6 +9,7 @@ import { genreLabel } from '../lib/genres'
import { backdropSrcSet, tmdbSized } from '../lib/tmdbImage' import { backdropSrcSet, tmdbSized } from '../lib/tmdbImage'
import { cx, formatDate } from '../lib/utils' import { cx, formatDate } from '../lib/utils'
import { useMedia } from '../store' import { useMedia } from '../store'
import { useToast } from './Toast'
import type { MediaItem } from '../types' import type { MediaItem } from '../types'
/** Où j'en suis : « S2 · É3 » (épisode suivant à voir) */ /** Où j'en suis : « S2 · É3 » (épisode suivant à voir) */
@@ -27,9 +28,23 @@ export function waitingLabel(item: MediaItem): string {
return date ? t('hero.nextOn', { date: formatDate(date) }) : t('hero.upToDate') return date ? t('hero.nextOn', { date: formatDate(date) }) : t('hero.upToDate')
} }
/** +1 depuis l'accueil : saison (ou série) finie → on ouvre la fiche sur la note ; revisionnage fini → petit message. */
function usePlusOne(onOpen: (item: MediaItem, focus?: Completion) => void) {
const { incrementEpisode } = useMedia()
const toast = useToast()
return (item: MediaItem) => {
const cap = episodeCap(item)
const endsRewatch = !!item.rewatch && !!cap && item.rewatch.episodes + 1 >= cap
return incrementEpisode(item.id).then((done) => {
if (done) onOpen(item, done)
else if (endsRewatch) toast.show(t('rewatch.finishedToast', { title: item.title }))
})
}
}
/** Grande bannière de l'accueil : défile entre les titres que je regarde en ce moment (ou le prochain à voir). */ /** Grande bannière de l'accueil : défile entre les titres que je regarde en ce moment (ou le prochain à voir). */
export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen: (item: MediaItem, focus?: Completion) => void }) { export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen: (item: MediaItem, focus?: Completion) => void }) {
const { incrementEpisode } = useMedia() const plusOne = usePlusOne(onOpen)
// On retient le titre affiché (et pas sa position) : la liste se réordonne quand on avance un épisode // On retient le titre affiché (et pas sa position) : la liste se réordonne quand on avance un épisode
const [currentId, setCurrentId] = useState<string>() const [currentId, setCurrentId] = useState<string>()
const [pausedAt, setPausedAt] = useState(0) const [pausedAt, setPausedAt] = useState(0)
@@ -99,7 +114,7 @@ export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen
<span className="absolute inset-0 bg-bg/50" /> <span className="absolute inset-0 bg-bg/50" />
</button> </button>
<div className="pointer-events-none absolute inset-x-0 bottom-0 p-5 lg:p-10"> <div className="pointer-events-none absolute inset-x-0 bottom-0 p-5 lg:p-10">
<p className="eyebrow text-ink-2">{item.status === 'en_cours' ? t('homeHero.continue') : t('homeHero.next')}</p> <p className="eyebrow text-ink-2">{item.rewatch ? t('rewatch.badge') : item.status === 'en_cours' ? t('homeHero.continue') : t('homeHero.next')}</p>
<h2 className="mt-1.5 line-clamp-2 text-[1.9rem] font-bold leading-[1.1] lg:text-5xl">{item.title}</h2> <h2 className="mt-1.5 line-clamp-2 text-[1.9rem] font-bold leading-[1.1] lg:text-5xl">{item.title}</h2>
{meta && <p className="mt-1.5 text-xs text-ink-2">{meta}</p>} {meta && <p className="mt-1.5 text-xs text-ink-2">{meta}</p>}
<div className="pointer-events-auto mt-4 flex items-center gap-2"> <div className="pointer-events-auto mt-4 flex items-center gap-2">
@@ -108,7 +123,7 @@ export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen
onClick={() => { onClick={() => {
setPausedAt(Date.now()) setPausedAt(Date.now())
// Saison (ou série) terminée : on ouvre la fiche sur la note // Saison (ou série) terminée : on ouvre la fiche sur la note
void incrementEpisode(item.id).then((done) => done && onOpen(item, done)) void plusOne(item)
}} }}
className="btn btn-primary px-5" className="btn btn-primary px-5"
> >
@@ -143,7 +158,7 @@ export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen
/** Carte horizontale « Reprendre » : image, barre de progression, prochain épisode. */ /** Carte horizontale « Reprendre » : image, barre de progression, prochain épisode. */
export function ContinueCard({ item, onOpen }: { item: MediaItem; onOpen: (item: MediaItem, focus?: Completion) => void }) { export function ContinueCard({ item, onOpen }: { item: MediaItem; onOpen: (item: MediaItem, focus?: Completion) => void }) {
const { incrementEpisode } = useMedia() const plusOne = usePlusOne(onOpen)
const image = item.backdrop ?? item.poster const image = item.backdrop ?? item.poster
const next = nextEpisodeLabel(item) const next = nextEpisodeLabel(item)
@@ -155,7 +170,7 @@ export function ContinueCard({ item, onOpen }: { item: MediaItem; onOpen: (item:
</button> </button>
{next && ( {next && (
<button <button
onClick={() => void incrementEpisode(item.id).then((done) => done && onOpen(item, done))} onClick={() => void plusOne(item)}
className="absolute bottom-3 end-2 flex h-8 items-center gap-0.5 rounded-full bg-accent-fill px-3 text-xs font-semibold text-on-accent transition active:scale-90" className="absolute bottom-3 end-2 flex h-8 items-center gap-0.5 rounded-full bg-accent-fill px-3 text-xs font-semibold text-on-accent transition active:scale-90"
aria-label={t('card.plusOne', { title: item.title })} aria-label={t('card.plusOne', { title: item.title })}
> >
@@ -165,7 +180,10 @@ export function ContinueCard({ item, onOpen }: { item: MediaItem; onOpen: (item:
</div> </div>
<button onClick={() => onOpen(item)} className="mt-2 block w-full text-start"> <button onClick={() => onOpen(item)} className="mt-2 block w-full text-start">
<span className="block truncate text-sm font-semibold">{item.title}</span> <span className="block truncate text-sm font-semibold">{item.title}</span>
<span className="block text-xs text-ink-3">{next ? t('homeHero.nextUp', { ep: next }) : waitingLabel(item)}</span> <span className="block text-xs text-ink-3">
{item.rewatch && <span className="font-medium text-accent">{t('rewatch.badge')} · </span>}
{next ? t('homeHero.nextUp', { ep: next }) : waitingLabel(item)}
</span>
</button> </button>
</article> </article>
) )
+2 -5
View File
@@ -1,8 +1,7 @@
import { locale, t } from '../i18n' import { locale, t } from '../i18n'
import { Star } from 'lucide-react' import { Star } from 'lucide-react'
import { useMemo, useState } from 'react' import { useMemo, useState } from 'react'
import { DEFAULT_FILM_MINUTES, TYPE_BY_VALUE } from '../lib/constants' import { oneViewMinutes, rewatchMinutes, watchMinutes } from '../lib/stats'
import { watchMinutes } from '../lib/stats'
import { cx, formatDuration, formatRating } from '../lib/utils' import { cx, formatDuration, formatRating } from '../lib/utils'
import { useMedia } from '../store' import { useMedia } from '../store'
import type { MediaItem } from '../types' import type { MediaItem } from '../types'
@@ -28,13 +27,11 @@ function buildEntries(items: MediaItem[]): Entry[] {
if (item.status === 'termine' && item.endDate) out.push({ date: item.endDate, item, kind: 'fini', minutes: watchMinutes(item) - rewatchMinutes(item) }) if (item.status === 'termine' && item.endDate) out.push({ date: item.endDate, item, kind: 'fini', minutes: watchMinutes(item) - rewatchMinutes(item) })
else if ((item.status === 'en_cours' || item.status === 'pause') && item.startDate) out.push({ date: item.startDate, item, kind: 'commence', minutes: 0 }) else if ((item.status === 'en_cours' || item.status === 'pause') && item.startDate) out.push({ date: item.startDate, item, kind: 'commence', minutes: 0 })
else if (item.status === 'abandonne' && (item.endDate || item.startDate)) out.push({ date: (item.endDate || item.startDate)!, item, kind: 'abandonne', minutes: 0 }) else if (item.status === 'abandonne' && (item.endDate || item.startDate)) out.push({ date: (item.endDate || item.startDate)!, item, kind: 'abandonne', minutes: 0 })
for (const d of item.rewatchDates ?? []) out.push({ date: d, item, kind: 'revu', minutes: TYPE_BY_VALUE[item.type].episodic ? 0 : item.duration || DEFAULT_FILM_MINUTES }) for (const d of item.rewatchDates ?? []) out.push({ date: d, item, kind: 'revu', minutes: oneViewMinutes(item) })
} }
return out.sort((a, b) => b.date.localeCompare(a.date) || a.item.title.localeCompare(b.item.title, locale())) return out.sort((a, b) => b.date.localeCompare(a.date) || a.item.title.localeCompare(b.item.title, locale()))
} }
const rewatchMinutes = (i: MediaItem) => (TYPE_BY_VALUE[i.type].episodic ? 0 : (i.rewatchDates?.length ?? 0) * (i.duration || DEFAULT_FILM_MINUTES))
/** Onglet « Journal » du catalogue : chronologie groupée par mois. */ /** Onglet « Journal » du catalogue : chronologie groupée par mois. */
export default function JournalView({ onOpen }: { onOpen: (item: MediaItem) => void }) { export default function JournalView({ onOpen }: { onOpen: (item: MediaItem) => void }) {
const { items, settings } = useMedia() const { items, settings } = useMedia()
+6 -3
View File
@@ -3,6 +3,7 @@ import { Heart, Plus } from 'lucide-react'
import { TYPE_BY_VALUE } from '../lib/constants' import { TYPE_BY_VALUE } from '../lib/constants'
import { canWatchMore } from '../lib/airing' import { canWatchMore } from '../lib/airing'
import { episodeCap, seasonPosition } from '../lib/franchise' import { episodeCap, seasonPosition } from '../lib/franchise'
import { progressView } from '../lib/rewatch'
import { useMedia } from '../store' import { useMedia } from '../store'
import type { MediaItem } from '../types' import type { MediaItem } from '../types'
import { StatusPill, TypeBadge } from './Badges' import { StatusPill, TypeBadge } from './Badges'
@@ -38,10 +39,12 @@ function Progress({ item }: { item: MediaItem }) {
/** Carte verticale (grille du catalogue). */ /** Carte verticale (grille du catalogue). */
export function MediaCard({ item, onOpen }: { item: MediaItem; onOpen: (item: MediaItem) => void }) { export function MediaCard({ item, onOpen }: { item: MediaItem; onOpen: (item: MediaItem) => void }) {
const { settings, incrementEpisode } = useMedia() const { settings, incrementEpisode } = useMedia()
// Revisionnage en cours : la progression montrée est celle du revisionnage
const view = progressView(item)
const canIncrement = const canIncrement =
TYPE_BY_VALUE[item.type].episodic && TYPE_BY_VALUE[item.type].episodic &&
item.status === 'en_cours' && view.status === 'en_cours' &&
canWatchMore(item) canWatchMore(view)
return ( return (
<article> <article>
@@ -69,7 +72,7 @@ export function MediaCard({ item, onOpen }: { item: MediaItem; onOpen: (item: Me
<StatusPill status={item.status} /> <StatusPill status={item.status} />
<RatingBadge value={item.rating} scale={settings.ratingScale} /> <RatingBadge value={item.rating} scale={settings.ratingScale} />
</div> </div>
<Progress item={item} /> <Progress item={view} />
</button> </button>
</article> </article>
) )
+111
View File
@@ -0,0 +1,111 @@
import { Check, RotateCcw } from 'lucide-react'
import { useState } from 'react'
import { t } from '../../i18n'
import { episodeCap } from '../../lib/franchise'
import { addRewatchDate, canTrackRewatch, MAX_REWATCHES, startRewatch, stopRewatch, viewCount } from '../../lib/rewatch'
import { formatDate, todayISO } from '../../lib/utils'
import type { MediaInput, MediaItem } from '../../types'
/**
* « Revoir » (titre terminé) : un film se note revu à une date ; une série se revoit épisode par épisode
* (progression à part, le premier visionnage ne bouge pas) ou se note revue d'un coup.
*/
export default function RewatchPanel({
item,
justFinished,
onChange,
onUndoable,
}: {
item: MediaItem
/** Le revisionnage vient de se terminer (dernier épisode coché) */
justFinished: boolean
onChange: (patch: Partial<MediaInput>) => void
/** Changement annulable (« Annuler » dans le toast) */
onUndoable: (patch: Partial<MediaInput>, message: string) => void
}) {
const [adding, setAdding] = useState(false)
const [date, setDate] = useState(todayISO())
const views = viewCount(item)
const full = (item.rewatchDates?.length ?? 0) >= MAX_REWATCHES
const trackable = canTrackRewatch(item)
const cap = episodeCap(item)
const addDate = () => {
if (!date || date > todayISO() || full) return
onUndoable(addRewatchDate(item, date), t('rewatch.added', { title: item.title }))
setAdding(false)
setDate(todayISO())
}
const dateForm = (
<div className="flex items-end gap-2">
<label className="block min-w-0 flex-1">
<span className="label">{t('form.rewatchDate')}</span>
<input className="field" type="date" value={date} max={todayISO()} onChange={(e) => setDate(e.target.value)} />
</label>
<button onClick={addDate} disabled={!date || full} className="btn btn-primary shrink-0 px-4 py-2.5 text-sm">
<Check size={16} /> {t('rewatch.add')}
</button>
</div>
)
return (
<section className="card mx-4 mt-4 p-4" aria-label={t('rewatch.title')}>
<div className="mb-3 flex items-baseline justify-between gap-3">
<h3 className="eyebrow text-ink-2">{t('rewatch.title')}</h3>
{views > 1 && <span className="text-xs font-medium text-ink-2">{t('rewatch.views', { count: views })}</span>}
</div>
{justFinished && !item.rewatch && (
<p className="mb-3 flex items-center gap-2 rounded-xl bg-surface-2 px-3 py-2.5 text-sm" role="status">
<Check size={16} className="shrink-0 text-accent" /> {t('rewatch.finished', { count: views })}
</p>
)}
{item.rewatch ? (
<div>
<p className="text-sm">
<span className="font-semibold text-accent">{t('rewatch.badge')}</span>
<span className="text-ink-3"> · {t('rewatch.since', { date: formatDate(item.rewatch.startDate) })}</span>
</p>
{cap ? (
<>
<p className="mt-1 text-xs text-ink-3">{t('rewatch.progress', { seen: item.rewatch.episodes, total: cap })}</p>
<div className="mt-2 h-1 rounded-full bg-surface-2">
<div className="h-full rounded-full bg-accent" style={{ width: `${Math.min(100, (item.rewatch.episodes / cap) * 100)}%` }} />
</div>
</>
) : null}
<p className="mt-3 text-xs text-ink-3">{t('rewatch.trackingHint')}</p>
<div className="mt-3 flex flex-wrap gap-2">
<button onClick={() => onUndoable({ ...stopRewatch(), ...addRewatchDate(item) }, t('rewatch.added', { title: item.title }))} className="btn btn-ghost px-4 py-2 text-sm">
<Check size={16} /> {t('rewatch.markDone')}
</button>
<button onClick={() => onUndoable(stopRewatch(), t('rewatch.stopped', { title: item.title }))} className="px-3 py-2 text-sm font-medium text-ink-3">
{t('rewatch.stop')}
</button>
</div>
</div>
) : trackable ? (
<div>
<button onClick={() => onChange(startRewatch())} className="btn btn-primary w-full py-3">
<RotateCcw size={17} /> {t('rewatch.start')}
</button>
<p className="mt-2 text-xs text-ink-3">{t('rewatch.startHint')}</p>
{adding ? (
<div className="mt-4">{dateForm}</div>
) : (
<button onClick={() => setAdding(true)} className="mt-3 text-sm font-medium text-ink-2">
{t('rewatch.alreadyDone')}
</button>
)}
</div>
) : (
<div>
<p className="mb-3 text-xs text-ink-3">{t('form.rewatchHint')}</p>
{dateForm}
</div>
)}
</section>
)
}
+45 -21
View File
@@ -30,6 +30,8 @@ import EditDetails from './EditDetails'
import ReviewEditor from './ReviewEditor' import ReviewEditor from './ReviewEditor'
import WhereToWatch from './WhereToWatch' import WhereToWatch from './WhereToWatch'
import SeasonRatings from './SeasonRatings' import SeasonRatings from './SeasonRatings'
import RewatchPanel from './RewatchPanel'
import { progressView, rewatchEpisodesPatch } from '../../lib/rewatch'
import { completionOf, hasSeasons, seasonsAverage, type Completion } from '../../lib/seasons' import { completionOf, hasSeasons, seasonsAverage, type Completion } from '../../lib/seasons'
import ReviewComments from '../social/ReviewComments' import ReviewComments from '../social/ReviewComments'
import SharedListPicker from '../social/SharedListPicker' import SharedListPicker from '../social/SharedListPicker'
@@ -233,8 +235,16 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
if (focus && 'final' in focus) ratingRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' }) if (focus && 'final' in focus) ratingRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' })
}, [focus]) }, [focus])
// Revisionnage qui vient de se terminer (dernier épisode coché ici)
const [rewatchDone, setRewatchDone] = useState(false)
const setEpisodes = (n: number, season?: number) => { const setEpisodes = (n: number, season?: number) => {
if (!item) return if (!item) return
// Revisionnage : sa propre progression, le premier visionnage reste tel quel
if (item.rewatch) {
const { patch, finished } = rewatchEpisodesPatch(item, n)
void update(item.id, patch).then(() => finished && setRewatchDone(true))
return
}
const done = completionOf(item, item.episodesWatched, n) const done = completionOf(item, item.episodesWatched, n)
void update(item.id, episodesPatch(item, n, season)).then(() => done && setFocus(done)) void update(item.id, episodesPatch(item, n, season)).then(() => done && setFocus(done))
} }
@@ -244,16 +254,18 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
const airingRef = item ? { id: item.id, type: item.type, externalId: item.externalId } : undefined const airingRef = item ? { id: item.id, type: item.type, externalId: item.externalId } : undefined
const aired = airingRef ? airedCount(airingRef, airingCache) : undefined const aired = airingRef ? airedCount(airingRef, airingCache) : undefined
/** Bouton principal des épisodes : « J'ai vu S2 · É3 », « À jour », « Tout vu »… */ /** Bouton principal des épisodes : « J'ai vu S2 · É3 », « À jour », « Tout vu »… */
// Pendant un revisionnage, les épisodes affichés sont ceux du revisionnage
const shown = item ? progressView(item) : undefined
const nextEpisode = (() => { const nextEpisode = (() => {
if (!item || !episodic) return undefined if (!shown || !episodic) return undefined
const cap = episodeCap(item) const cap = episodeCap(shown)
if (cap && item.episodesWatched >= cap) return { label: t('hero.allSeen'), done: true } if (cap && shown.episodesWatched >= cap) return { label: t('hero.allSeen'), done: true }
if (aired != null && item.episodesWatched >= aired) { if (aired != null && shown.episodesWatched >= aired) {
const date = airingRef ? nextAirDate(airingRef, airingCache) : undefined const date = airingRef ? nextAirDate(airingRef, airingCache) : undefined
return { label: date ? t('hero.nextOn', { date: formatDate(date) }) : t('hero.upToDate'), done: true } return { label: date ? t('hero.nextOn', { date: formatDate(date) }) : t('hero.upToDate'), done: true }
} }
const pos = seasonPosition({ ...item, episodesWatched: item.episodesWatched + 1, season: undefined }) const pos = seasonPosition({ ...shown, episodesWatched: shown.episodesWatched + 1, season: undefined })
const ep = t('episodes.short', { n: pos ? pos.episode : item.episodesWatched + 1 }) const ep = t('episodes.short', { n: pos ? pos.episode : shown.episodesWatched + 1 })
return { label: t('hero.seenEp', { ep: pos ? `${t('episodes.seasonShort', { n: pos.season })} · ${ep}` : ep }), done: false } return { label: t('hero.seenEp', { ep: pos ? `${t('episodes.seasonShort', { n: pos.season })} · ${ep}` : ep }), done: false }
})() })()
const hasEpisodeList = !!item && (!!item.seasons || (!!item.externalId && !!item.episodesTotal)) const hasEpisodeList = !!item && (!!item.seasons || (!!item.externalId && !!item.episodesTotal))
@@ -453,12 +465,29 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
)} )}
</section> </section>
{/* Revoir (titre terminé) */}
{item && item.status === 'termine' && (
<RewatchPanel
item={item}
justFinished={rewatchDone}
onChange={(patch) => {
setRewatchDone(false)
void update(item.id, patch)
}}
onUndoable={(patch, message) => {
const before = item
setRewatchDone(false)
void update(item.id, patch).then(() => actions.offerUndo(message, [before]))
}}
/>
)}
{/* Épisodes */} {/* Épisodes */}
{item && episodic && ( {item && shown && episodic && (
<section className="mx-4 mt-4"> <section className="mx-4 mt-4">
{nextEpisode && ( {nextEpisode && (
<button <button
onClick={nextEpisode.done ? undefined : () => setEpisodes(item.episodesWatched + 1)} onClick={nextEpisode.done ? undefined : () => setEpisodes(shown.episodesWatched + 1)}
disabled={nextEpisode.done} disabled={nextEpisode.done}
className={cx('btn mb-3 w-full py-3', nextEpisode.done ? 'btn-ghost' : 'btn-primary')} className={cx('btn mb-3 w-full py-3', nextEpisode.done ? 'btn-ghost' : 'btn-primary')}
> >
@@ -467,29 +496,29 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
</button> </button>
)} )}
{hasEpisodeList ? ( {hasEpisodeList ? (
<EpisodeList form={item} aired={aired} onChange={setEpisodes} /> <EpisodeList form={shown} aired={aired} onChange={setEpisodes} />
) : ( ) : (
<div className="card p-4"> <div className="card p-4">
<div className="flex items-center justify-between gap-3"> <div className="flex items-center justify-between gap-3">
<div> <div>
<span className="eyebrow">{t('home.episodesSeen')}</span> <span className="eyebrow">{t('home.episodesSeen')}</span>
<p className="mt-1 text-2xl font-bold tabular-nums"> <p className="mt-1 text-2xl font-bold tabular-nums">
{item.episodesWatched} {shown.episodesWatched}
{episodeCap(item) ? <span className="text-base font-normal text-ink-3"> / {episodeCap(item)}</span> : null} {episodeCap(shown) ? <span className="text-base font-normal text-ink-3"> / {episodeCap(shown)}</span> : null}
</p> </p>
</div> </div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<button onClick={() => setEpisodes(item.episodesWatched - 1)} className="grid size-11 place-items-center rounded-full border border-line-strong text-ink-2" aria-label={t('form.minusEp')}> <button onClick={() => setEpisodes(shown.episodesWatched - 1)} className="grid size-11 place-items-center rounded-full border border-line-strong text-ink-2" aria-label={t('form.minusEp')}>
<Minus size={18} /> <Minus size={18} />
</button> </button>
<button onClick={() => setEpisodes(item.episodesWatched + 1)} className="grid size-11 place-items-center rounded-full bg-accent-fill text-on-accent" aria-label={t('form.plusEp')}> <button onClick={() => setEpisodes(shown.episodesWatched + 1)} className="grid size-11 place-items-center rounded-full bg-accent-fill text-on-accent" aria-label={t('form.plusEp')}>
<Plus size={18} strokeWidth={2.5} /> <Plus size={18} strokeWidth={2.5} />
</button> </button>
</div> </div>
</div> </div>
{episodeCap(item) ? ( {episodeCap(shown) ? (
<div className="mt-3 h-1 rounded-full bg-surface-2"> <div className="mt-3 h-1 rounded-full bg-surface-2">
<div className="h-full rounded-full bg-accent" style={{ width: `${Math.min(100, (item.episodesWatched / episodeCap(item)!) * 100)}%` }} /> <div className="h-full rounded-full bg-accent" style={{ width: `${Math.min(100, (shown.episodesWatched / episodeCap(shown)!) * 100)}%` }} />
</div> </div>
) : null} ) : null}
</div> </div>
@@ -869,12 +898,7 @@ function Tracking({ item, lists, tagSuggestions, onChange }: { item: MediaItem;
))} ))}
</ul> </ul>
)} )}
<button {!rewatches.length && <p className="text-xs text-ink-3">{t('rewatch.historyEmpty')}</p>}
onClick={() => rewatches.length < 100 && onChange({ rewatchDates: [todayISO(), ...rewatches].sort().reverse() })}
className="btn btn-ghost py-2 text-sm"
>
<Plus size={16} /> {t('title.rewatchedToday')}
</button>
</div> </div>
</div> </div>
)} )}
+21
View File
@@ -1570,6 +1570,27 @@ const dict: Translations = {
'seasons.writeReview': "اكتب مراجعة لهذا الموسم", 'seasons.writeReview': "اكتب مراجعة لهذا الموسم",
'seasons.finalHint': "عند انتهاء المسلسل سيكون تقييمك متوسط المواسم التي قيّمتها.", 'seasons.finalHint': "عند انتهاء المسلسل سيكون تقييمك متوسط المواسم التي قيّمتها.",
'seasons.finalApplied': "متوسط المواسم التي قيّمتها.", 'seasons.finalApplied': "متوسط المواسم التي قيّمتها.",
"rewatch.title": "إعادة المشاهدة",
"rewatch.badge": "إعادة مشاهدة جارية",
"rewatch.views_one": "شوهد مرة واحدة",
"rewatch.views_other": "شوهد {count} مرة",
"rewatch.added": "«{title}»: أُضيفت إعادة مشاهدة",
"rewatch.add": "إضافة",
"rewatch.finished": "انتهت إعادة المشاهدة وأُضيفت إلى سجلك.",
"rewatch.since": "بدأت في {date}",
"rewatch.progress": "{seen} / {total} حلقة أُعيدت مشاهدتها",
"rewatch.trackingHint": "الحلقات التي تحددها الآن تُحسب لإعادة المشاهدة هذه. مشاهدتك الأولى وتقييمك ومراجعاتك تبقى كما هي.",
"rewatch.markDone": "إنهاء الآن",
"rewatch.stop": "إيقاف",
"rewatch.stopped": "«{title}»: أُوقفت إعادة المشاهدة",
"rewatch.start": "بدء إعادة مشاهدة",
"rewatch.startHint": "يبدأ التقدم من الحلقة 1 دون المساس بمشاهدتك الأولى.",
"rewatch.alreadyDone": "أعدت مشاهدته من قبل؟ أضف تاريخًا",
"rewatch.historyEmpty": "لا توجد إعادة مشاهدة بعد: استخدم «إعادة المشاهدة» أعلاه.",
"rewatch.views_two": "شوهد مرتين",
"rewatch.views_few": "شوهد {count} مرات",
"rewatch.views_many": "شوهد {count} مرة",
"rewatch.finishedToast": "«{title}»: انتهت إعادة المشاهدة",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "Eine Rezension zu dieser Staffel schreiben", 'seasons.writeReview': "Eine Rezension zu dieser Staffel schreiben",
'seasons.finalHint': "Am Ende der Serie ist deine Bewertung der Durchschnitt deiner bewerteten Staffeln.", 'seasons.finalHint': "Am Ende der Serie ist deine Bewertung der Durchschnitt deiner bewerteten Staffeln.",
'seasons.finalApplied': "Durchschnitt deiner bewerteten Staffeln.", 'seasons.finalApplied': "Durchschnitt deiner bewerteten Staffeln.",
"rewatch.title": "Erneut ansehen",
"rewatch.badge": "Erneutes Ansehen",
"rewatch.views_one": "{count}-mal gesehen",
"rewatch.views_other": "{count}-mal gesehen",
"rewatch.added": "„{title}“: erneutes Ansehen hinzugefügt",
"rewatch.add": "Hinzufügen",
"rewatch.finished": "Erneutes Ansehen beendet, es steht jetzt in deinem Verlauf.",
"rewatch.since": "begonnen am {date}",
"rewatch.progress": "{seen} / {total} Folgen erneut gesehen",
"rewatch.trackingHint": "Folgen, die du jetzt abhakst, zählen für dieses erneute Ansehen. Dein erstes Ansehen, deine Bewertung und Rezensionen bleiben unverändert.",
"rewatch.markDone": "Jetzt abschließen",
"rewatch.stop": "Abbrechen",
"rewatch.stopped": "„{title}“: erneutes Ansehen abgebrochen",
"rewatch.start": "Erneut ansehen beginnen",
"rewatch.startHint": "Der Fortschritt beginnt wieder bei Folge 1, dein erstes Ansehen bleibt unberührt.",
"rewatch.alreadyDone": "Schon erneut gesehen? Datum hinzufügen",
"rewatch.historyEmpty": "Noch kein erneutes Ansehen: nutze „Erneut ansehen“ oben.",
"rewatch.finishedToast": "„{title}“: erneutes Ansehen beendet",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "Write a review of this season", 'seasons.writeReview': "Write a review of this season",
'seasons.finalHint': "When the show is finished, your rating will be the average of your rated seasons.", 'seasons.finalHint': "When the show is finished, your rating will be the average of your rated seasons.",
'seasons.finalApplied': "Average of your rated seasons.", 'seasons.finalApplied': "Average of your rated seasons.",
"rewatch.title": "Rewatch",
"rewatch.badge": "Rewatching",
"rewatch.views_one": "Watched {count} time",
"rewatch.views_other": "Watched {count} times",
"rewatch.added": "“{title}”: rewatch added",
"rewatch.add": "Add",
"rewatch.finished": "Rewatch finished, it’s now in your history.",
"rewatch.since": "started {date}",
"rewatch.progress": "{seen} / {total} episodes rewatched",
"rewatch.trackingHint": "Episodes you check now count toward this rewatch. Your first watch, rating and reviews stay as they are.",
"rewatch.markDone": "Finish now",
"rewatch.stop": "Stop",
"rewatch.stopped": "“{title}”: rewatch stopped",
"rewatch.start": "Start a rewatch",
"rewatch.startHint": "Progress starts again from episode 1, without touching your first watch.",
"rewatch.alreadyDone": "Already rewatched? Add a date",
"rewatch.historyEmpty": "No rewatches yet: use “Rewatch” above.",
"rewatch.finishedToast": "“{title}”: rewatch finished",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "Escribir una reseña de esta temporada", 'seasons.writeReview': "Escribir una reseña de esta temporada",
'seasons.finalHint': "Al terminar la serie, tu nota será la media de tus temporadas puntuadas.", 'seasons.finalHint': "Al terminar la serie, tu nota será la media de tus temporadas puntuadas.",
'seasons.finalApplied': "Media de tus temporadas puntuadas.", 'seasons.finalApplied': "Media de tus temporadas puntuadas.",
"rewatch.title": "Volver a ver",
"rewatch.badge": "Revisionado",
"rewatch.views_one": "Visto {count} vez",
"rewatch.views_other": "Visto {count} veces",
"rewatch.added": "«{title}»: revisionado añadido",
"rewatch.add": "Añadir",
"rewatch.finished": "Revisionado terminado, ya está en tu historial.",
"rewatch.since": "empezado el {date}",
"rewatch.progress": "{seen} / {total} episodios vueltos a ver",
"rewatch.trackingHint": "Los episodios que marques cuentan para este revisionado. Tu primer visionado, tu nota y tus reseñas no cambian.",
"rewatch.markDone": "Terminar ahora",
"rewatch.stop": "Detener",
"rewatch.stopped": "«{title}»: revisionado detenido",
"rewatch.start": "Empezar un revisionado",
"rewatch.startHint": "El progreso vuelve al episodio 1, sin tocar tu primer visionado.",
"rewatch.alreadyDone": "¿Ya lo volviste a ver? Añadir una fecha",
"rewatch.historyEmpty": "Aún no hay revisionados: usa «Volver a ver» arriba.",
"rewatch.finishedToast": "«{title}»: revisionado terminado",
} }
export default dict export default dict
+18
View File
@@ -1349,6 +1349,24 @@ const dict = {
'seasons.writeReview': "Écrire un avis sur cette saison", 'seasons.writeReview': "Écrire un avis sur cette saison",
'seasons.finalHint': "À la fin de la série, ta note sera la moyenne de tes saisons notées.", 'seasons.finalHint': "À la fin de la série, ta note sera la moyenne de tes saisons notées.",
'seasons.finalApplied': "Moyenne de tes saisons notées.", 'seasons.finalApplied': "Moyenne de tes saisons notées.",
"rewatch.title": "Revoir",
"rewatch.badge": "Revisionnage",
"rewatch.views_one": "Vu {count} fois",
"rewatch.views_other": "Vu {count} fois",
"rewatch.added": "« {title} » : revisionnage ajouté",
"rewatch.add": "Ajouter",
"rewatch.finished": "Revisionnage terminé, il rejoint ton historique.",
"rewatch.since": "commencé le {date}",
"rewatch.progress": "{seen} / {total} épisodes revus",
"rewatch.trackingHint": "Les épisodes que tu coches comptent pour ce revisionnage. Ton premier visionnage, ta note et tes avis restent intacts.",
"rewatch.markDone": "Terminer maintenant",
"rewatch.stop": "Arrêter",
"rewatch.stopped": "« {title} » : revisionnage arrêté",
"rewatch.start": "Commencer un revisionnage",
"rewatch.startHint": "La progression repart de l’épisode 1, sans toucher à ton premier visionnage.",
"rewatch.alreadyDone": "Déjà revu ? Ajouter une date",
"rewatch.historyEmpty": "Aucun revisionnage pour l’instant : utilise « Revoir » plus haut.",
"rewatch.finishedToast": "« {title} » : revisionnage terminé",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "इस सीज़न की समीक्षा लिखें", 'seasons.writeReview': "इस सीज़न की समीक्षा लिखें",
'seasons.finalHint': "सीरीज़ पूरी होने पर आपकी रेटिंग रेट किए सीज़नों का औसत होगी।", 'seasons.finalHint': "सीरीज़ पूरी होने पर आपकी रेटिंग रेट किए सीज़नों का औसत होगी।",
'seasons.finalApplied': "रेट किए सीज़नों का औसत।", 'seasons.finalApplied': "रेट किए सीज़नों का औसत।",
"rewatch.title": "फिर से देखें",
"rewatch.badge": "दोबारा देख रहे हैं",
"rewatch.views_one": "{count} बार देखा",
"rewatch.views_other": "{count} बार देखा",
"rewatch.added": "“{title}”: दोबारा देखना जोड़ा गया",
"rewatch.add": "जोड़ें",
"rewatch.finished": "दोबारा देखना पूरा हुआ, अब यह आपके इतिहास में है।",
"rewatch.since": "{date} को शुरू हुआ",
"rewatch.progress": "{seen} / {total} एपिसोड दोबारा देखे",
"rewatch.trackingHint": "अब आप जो एपिसोड चुनेंगे वे इस बार दोबारा देखने में गिने जाएंगे। आपका पहला देखना, रेटिंग और समीक्षाएँ वैसी ही रहेंगी।",
"rewatch.markDone": "अभी पूरा करें",
"rewatch.stop": "रोकें",
"rewatch.stopped": "“{title}”: दोबारा देखना रोका गया",
"rewatch.start": "दोबारा देखना शुरू करें",
"rewatch.startHint": "प्रगति एपिसोड 1 से फिर शुरू होगी, आपके पहले देखने पर कोई असर नहीं।",
"rewatch.alreadyDone": "पहले ही दोबारा देख लिया? तारीख जोड़ें",
"rewatch.historyEmpty": "अभी तक दोबारा नहीं देखा: ऊपर “फिर से देखें” का उपयोग करें।",
"rewatch.finishedToast": "“{title}”: दोबारा देखना पूरा हुआ",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "Tulis ulasan musim ini", 'seasons.writeReview': "Tulis ulasan musim ini",
'seasons.finalHint': "Saat serial selesai, nilaimu jadi rata-rata musim yang kamu nilai.", 'seasons.finalHint': "Saat serial selesai, nilaimu jadi rata-rata musim yang kamu nilai.",
'seasons.finalApplied': "Rata-rata musim yang kamu nilai.", 'seasons.finalApplied': "Rata-rata musim yang kamu nilai.",
"rewatch.title": "Tonton ulang",
"rewatch.badge": "Menonton ulang",
"rewatch.views_one": "Ditonton {count} kali",
"rewatch.views_other": "Ditonton {count} kali",
"rewatch.added": "“{title}”: tonton ulang ditambahkan",
"rewatch.add": "Tambah",
"rewatch.finished": "Tonton ulang selesai, kini ada di riwayatmu.",
"rewatch.since": "dimulai {date}",
"rewatch.progress": "{seen} / {total} episode ditonton ulang",
"rewatch.trackingHint": "Episode yang kamu centang sekarang dihitung untuk tonton ulang ini. Tontonan pertama, nilai, dan ulasanmu tidak berubah.",
"rewatch.markDone": "Selesaikan sekarang",
"rewatch.stop": "Hentikan",
"rewatch.stopped": "“{title}”: tonton ulang dihentikan",
"rewatch.start": "Mulai tonton ulang",
"rewatch.startHint": "Progres mulai lagi dari episode 1, tanpa mengubah tontonan pertamamu.",
"rewatch.alreadyDone": "Sudah ditonton ulang? Tambah tanggal",
"rewatch.historyEmpty": "Belum ada tonton ulang: gunakan “Tonton ulang” di atas.",
"rewatch.finishedToast": "“{title}”: tonton ulang selesai",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "Scrivi una recensione di questa stagione", 'seasons.writeReview': "Scrivi una recensione di questa stagione",
'seasons.finalHint': "Finita la serie, il tuo voto sarà la media delle stagioni votate.", 'seasons.finalHint': "Finita la serie, il tuo voto sarà la media delle stagioni votate.",
'seasons.finalApplied': "Media delle stagioni votate.", 'seasons.finalApplied': "Media delle stagioni votate.",
"rewatch.title": "Rivedi",
"rewatch.badge": "Nuova visione",
"rewatch.views_one": "Visto {count} volta",
"rewatch.views_other": "Visto {count} volte",
"rewatch.added": "«{title}»: nuova visione aggiunta",
"rewatch.add": "Aggiungi",
"rewatch.finished": "Nuova visione terminata, ora è nella tua cronologia.",
"rewatch.since": "iniziata il {date}",
"rewatch.progress": "{seen} / {total} episodi rivisti",
"rewatch.trackingHint": "Gli episodi che segni contano per questa nuova visione. La prima visione, il voto e le recensioni restano invariati.",
"rewatch.markDone": "Termina ora",
"rewatch.stop": "Interrompi",
"rewatch.stopped": "«{title}»: nuova visione interrotta",
"rewatch.start": "Inizia una nuova visione",
"rewatch.startHint": "Il progresso riparte dall’episodio 1, senza toccare la prima visione.",
"rewatch.alreadyDone": "Già rivisto? Aggiungi una data",
"rewatch.historyEmpty": "Nessuna nuova visione per ora: usa «Rivedi» qui sopra.",
"rewatch.finishedToast": "«{title}»: nuova visione terminata",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "このシーズンのレビューを書く", 'seasons.writeReview': "このシーズンのレビューを書く",
'seasons.finalHint': "シリーズを観終えると、評価したシーズンの平均があなたの評価になります。", 'seasons.finalHint': "シリーズを観終えると、評価したシーズンの平均があなたの評価になります。",
'seasons.finalApplied': "評価したシーズンの平均です。", 'seasons.finalApplied': "評価したシーズンの平均です。",
"rewatch.title": "もう一度見る",
"rewatch.badge": "再視聴中",
"rewatch.views_one": "{count} 回視聴",
"rewatch.views_other": "{count} 回視聴",
"rewatch.added": "「{title}」:再視聴を追加しました",
"rewatch.add": "追加",
"rewatch.finished": "再視聴が完了し、履歴に追加されました。",
"rewatch.since": "{date} に開始",
"rewatch.progress": "{seen} / {total} 話を再視聴",
"rewatch.trackingHint": "今チェックしたエピソードはこの再視聴にカウントされます。最初の視聴、評価、レビューはそのままです。",
"rewatch.markDone": "今すぐ完了",
"rewatch.stop": "中止",
"rewatch.stopped": "「{title}」:再視聴を中止しました",
"rewatch.start": "再視聴を始める",
"rewatch.startHint": "進捗は第1話から再スタートし、最初の視聴には影響しません。",
"rewatch.alreadyDone": "もう再視聴した?日付を追加",
"rewatch.historyEmpty": "まだ再視聴はありません:上の「もう一度見る」を使ってください。",
"rewatch.finishedToast": "「{title}」:再視聴が完了しました",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "이 시즌 리뷰 쓰기", 'seasons.writeReview': "이 시즌 리뷰 쓰기",
'seasons.finalHint': "시리즈를 다 보면 평가한 시즌들의 평균이 평점이 돼요.", 'seasons.finalHint': "시리즈를 다 보면 평가한 시즌들의 평균이 평점이 돼요.",
'seasons.finalApplied': "평가한 시즌들의 평균이에요.", 'seasons.finalApplied': "평가한 시즌들의 평균이에요.",
"rewatch.title": "다시 보기",
"rewatch.badge": "다시 보는 중",
"rewatch.views_one": "{count}번 봄",
"rewatch.views_other": "{count}번 봄",
"rewatch.added": "‘{title}’: 다시 보기 추가됨",
"rewatch.add": "추가",
"rewatch.finished": "다시 보기를 마쳤어요. 기록에 추가됐어요.",
"rewatch.since": "{date} 시작",
"rewatch.progress": "{seen} / {total}화 다시 봄",
"rewatch.trackingHint": "지금 체크하는 회차는 이번 다시 보기에 포함돼요. 첫 시청, 평점, 리뷰는 그대로예요.",
"rewatch.markDone": "지금 완료",
"rewatch.stop": "중단",
"rewatch.stopped": "‘{title}’: 다시 보기 중단됨",
"rewatch.start": "다시 보기 시작",
"rewatch.startHint": "진행률이 1화부터 다시 시작되며 첫 시청에는 영향이 없어요.",
"rewatch.alreadyDone": "이미 다시 봤나요? 날짜 추가",
"rewatch.historyEmpty": "아직 다시 본 기록이 없어요: 위의 ‘다시 보기’를 사용하세요.",
"rewatch.finishedToast": "‘{title}’: 다시 보기 완료",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "Een recensie over dit seizoen schrijven", 'seasons.writeReview': "Een recensie over dit seizoen schrijven",
'seasons.finalHint': "Aan het eind van de serie is je score het gemiddelde van je beoordeelde seizoenen.", 'seasons.finalHint': "Aan het eind van de serie is je score het gemiddelde van je beoordeelde seizoenen.",
'seasons.finalApplied': "Gemiddelde van je beoordeelde seizoenen.", 'seasons.finalApplied': "Gemiddelde van je beoordeelde seizoenen.",
"rewatch.title": "Opnieuw kijken",
"rewatch.badge": "Opnieuw aan het kijken",
"rewatch.views_one": "{count} keer gezien",
"rewatch.views_other": "{count} keer gezien",
"rewatch.added": "‘{title}’: opnieuw kijken toegevoegd",
"rewatch.add": "Toevoegen",
"rewatch.finished": "Opnieuw kijken afgerond, het staat nu in je geschiedenis.",
"rewatch.since": "begonnen op {date}",
"rewatch.progress": "{seen} / {total} afleveringen opnieuw gezien",
"rewatch.trackingHint": "Afleveringen die je nu afvinkt tellen voor deze nieuwe kijkbeurt. Je eerste keer, je score en recensies blijven zoals ze zijn.",
"rewatch.markDone": "Nu afronden",
"rewatch.stop": "Stoppen",
"rewatch.stopped": "‘{title}’: opnieuw kijken gestopt",
"rewatch.start": "Opnieuw beginnen met kijken",
"rewatch.startHint": "De voortgang begint weer bij aflevering 1, zonder je eerste keer te wijzigen.",
"rewatch.alreadyDone": "Al opnieuw gezien? Datum toevoegen",
"rewatch.historyEmpty": "Nog niet opnieuw gekeken: gebruik ‘Opnieuw kijken’ hierboven.",
"rewatch.finishedToast": "‘{title}’: opnieuw kijken afgerond",
} }
export default dict export default dict
+20
View File
@@ -1487,6 +1487,26 @@ const dict: Translations = {
'seasons.writeReview': "Napisz recenzję tego sezonu", 'seasons.writeReview': "Napisz recenzję tego sezonu",
'seasons.finalHint': "Po skończeniu serialu twoja ocena będzie średnią ocenionych sezonów.", 'seasons.finalHint': "Po skończeniu serialu twoja ocena będzie średnią ocenionych sezonów.",
'seasons.finalApplied': "Średnia ocenionych sezonów.", 'seasons.finalApplied': "Średnia ocenionych sezonów.",
"rewatch.title": "Obejrzyj ponownie",
"rewatch.badge": "Ponowne oglądanie",
"rewatch.views_one": "Obejrzane {count} raz",
"rewatch.views_other": "Obejrzane {count} razy",
"rewatch.added": "„{title}”: dodano ponowne obejrzenie",
"rewatch.add": "Dodaj",
"rewatch.finished": "Ponowne oglądanie zakończone, jest już w twojej historii.",
"rewatch.since": "rozpoczęte {date}",
"rewatch.progress": "{seen} / {total} odcinków obejrzanych ponownie",
"rewatch.trackingHint": "Zaznaczane teraz odcinki liczą się do ponownego oglądania. Pierwsze obejrzenie, ocena i recenzje się nie zmieniają.",
"rewatch.markDone": "Zakończ teraz",
"rewatch.stop": "Przerwij",
"rewatch.stopped": "„{title}”: przerwano ponowne oglądanie",
"rewatch.start": "Zacznij oglądać ponownie",
"rewatch.startHint": "Postęp zaczyna się od odcinka 1, pierwsze obejrzenie zostaje bez zmian.",
"rewatch.alreadyDone": "Już obejrzane ponownie? Dodaj datę",
"rewatch.historyEmpty": "Brak ponownych obejrzeń: użyj „Obejrzyj ponownie” powyżej.",
"rewatch.views_few": "Obejrzane {count} razy",
"rewatch.views_many": "Obejrzane {count} razy",
"rewatch.finishedToast": "„{title}”: ponowne oglądanie zakończone",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "Escrever uma crítica desta temporada", 'seasons.writeReview': "Escrever uma crítica desta temporada",
'seasons.finalHint': "No fim da série, a tua nota será a média das temporadas avaliadas.", 'seasons.finalHint': "No fim da série, a tua nota será a média das temporadas avaliadas.",
'seasons.finalApplied': "Média das tuas temporadas avaliadas.", 'seasons.finalApplied': "Média das tuas temporadas avaliadas.",
"rewatch.title": "Rever",
"rewatch.badge": "Revendo",
"rewatch.views_one": "Visto {count} vez",
"rewatch.views_other": "Visto {count} vezes",
"rewatch.added": "“{title}”: nova visualização adicionada",
"rewatch.add": "Adicionar",
"rewatch.finished": "Nova visualização concluída, agora está no seu histórico.",
"rewatch.since": "iniciada em {date}",
"rewatch.progress": "{seen} / {total} episódios revistos",
"rewatch.trackingHint": "Os episódios que você marcar contam para esta nova visualização. A primeira, sua nota e suas avaliações não mudam.",
"rewatch.markDone": "Concluir agora",
"rewatch.stop": "Parar",
"rewatch.stopped": "“{title}”: nova visualização interrompida",
"rewatch.start": "Começar a rever",
"rewatch.startHint": "O progresso volta ao episódio 1, sem mexer na sua primeira visualização.",
"rewatch.alreadyDone": "Já reviu? Adicionar uma data",
"rewatch.historyEmpty": "Nenhuma nova visualização ainda: use “Rever” acima.",
"rewatch.finishedToast": "“{title}”: nova visualização concluída",
} }
export default dict export default dict
+20
View File
@@ -1487,6 +1487,26 @@ const dict: Translations = {
'seasons.writeReview': "Написать отзыв об этом сезоне", 'seasons.writeReview': "Написать отзыв об этом сезоне",
'seasons.finalHint': "В конце сериала оценкой станет среднее по оценённым сезонам.", 'seasons.finalHint': "В конце сериала оценкой станет среднее по оценённым сезонам.",
'seasons.finalApplied': "Среднее по оценённым сезонам.", 'seasons.finalApplied': "Среднее по оценённым сезонам.",
"rewatch.title": "Пересмотреть",
"rewatch.badge": "Пересмотр",
"rewatch.views_one": "Просмотрено {count} раз",
"rewatch.views_other": "Просмотрено {count} раза",
"rewatch.added": "«{title}»: пересмотр добавлен",
"rewatch.add": "Добавить",
"rewatch.finished": "Пересмотр завершён и добавлен в историю.",
"rewatch.since": "начат {date}",
"rewatch.progress": "Пересмотрено серий: {seen} / {total}",
"rewatch.trackingHint": "Отмеченные сейчас серии засчитываются в пересмотр. Первый просмотр, оценка и отзывы не меняются.",
"rewatch.markDone": "Завершить сейчас",
"rewatch.stop": "Остановить",
"rewatch.stopped": "«{title}»: пересмотр остановлен",
"rewatch.start": "Начать пересмотр",
"rewatch.startHint": "Прогресс начнётся с 1-й серии, первый просмотр не изменится.",
"rewatch.alreadyDone": "Уже пересмотрели? Добавить дату",
"rewatch.historyEmpty": "Пересмотров пока нет: нажмите «Пересмотреть» выше.",
"rewatch.views_few": "Просмотрено {count} раза",
"rewatch.views_many": "Просмотрено {count} раз",
"rewatch.finishedToast": "«{title}»: пересмотр завершён",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "เขียนรีวิวซีซันนี้", 'seasons.writeReview': "เขียนรีวิวซีซันนี้",
'seasons.finalHint': "เมื่อดูซีรีส์จบ คะแนนของคุณจะเป็นค่าเฉลี่ยของซีซันที่ให้คะแนน", 'seasons.finalHint': "เมื่อดูซีรีส์จบ คะแนนของคุณจะเป็นค่าเฉลี่ยของซีซันที่ให้คะแนน",
'seasons.finalApplied': "ค่าเฉลี่ยของซีซันที่คุณให้คะแนน", 'seasons.finalApplied': "ค่าเฉลี่ยของซีซันที่คุณให้คะแนน",
"rewatch.title": "ดูซ้ำ",
"rewatch.badge": "กำลังดูซ้ำ",
"rewatch.views_one": "ดูแล้ว {count} ครั้ง",
"rewatch.views_other": "ดูแล้ว {count} ครั้ง",
"rewatch.added": "“{title}”: เพิ่มการดูซ้ำแล้ว",
"rewatch.add": "เพิ่ม",
"rewatch.finished": "ดูซ้ำจบแล้ว และถูกเพิ่มในประวัติของคุณ",
"rewatch.since": "เริ่มเมื่อ {date}",
"rewatch.progress": "ดูซ้ำแล้ว {seen} / {total} ตอน",
"rewatch.trackingHint": "ตอนที่คุณติ๊กตอนนี้จะนับเป็นการดูซ้ำครั้งนี้ การดูครั้งแรก คะแนน และรีวิวของคุณจะไม่เปลี่ยน",
"rewatch.markDone": "จบตอนนี้",
"rewatch.stop": "หยุด",
"rewatch.stopped": "“{title}”: หยุดการดูซ้ำแล้ว",
"rewatch.start": "เริ่มดูซ้ำ",
"rewatch.startHint": "ความคืบหน้าเริ่มใหม่จากตอนที่ 1 โดยไม่กระทบการดูครั้งแรก",
"rewatch.alreadyDone": "ดูซ้ำไปแล้ว? เพิ่มวันที่",
"rewatch.historyEmpty": "ยังไม่มีการดูซ้ำ: ใช้ “ดูซ้ำ” ด้านบน",
"rewatch.finishedToast": "“{title}”: ดูซ้ำจบแล้ว",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "Bu sezon için inceleme yaz", 'seasons.writeReview': "Bu sezon için inceleme yaz",
'seasons.finalHint': "Dizi bitince puanın, puanladığın sezonların ortalaması olacak.", 'seasons.finalHint': "Dizi bitince puanın, puanladığın sezonların ortalaması olacak.",
'seasons.finalApplied': "Puanladığın sezonların ortalaması.", 'seasons.finalApplied': "Puanladığın sezonların ortalaması.",
"rewatch.title": "Yeniden izle",
"rewatch.badge": "Yeniden izleniyor",
"rewatch.views_one": "{count} kez izlendi",
"rewatch.views_other": "{count} kez izlendi",
"rewatch.added": "“{title}”: yeniden izleme eklendi",
"rewatch.add": "Ekle",
"rewatch.finished": "Yeniden izleme bitti, artık geçmişinde.",
"rewatch.since": "{date} tarihinde başladı",
"rewatch.progress": "{seen} / {total} bölüm yeniden izlendi",
"rewatch.trackingHint": "Şimdi işaretlediğin bölümler bu yeniden izlemeye sayılır. İlk izlemen, puanın ve incelemelerin değişmez.",
"rewatch.markDone": "Şimdi bitir",
"rewatch.stop": "Durdur",
"rewatch.stopped": "“{title}”: yeniden izleme durduruldu",
"rewatch.start": "Yeniden izlemeye başla",
"rewatch.startHint": "İlerleme 1. bölümden yeniden başlar, ilk izlemene dokunulmaz.",
"rewatch.alreadyDone": "Zaten yeniden izledin mi? Tarih ekle",
"rewatch.historyEmpty": "Henüz yeniden izleme yok: yukarıdaki “Yeniden izle”yi kullan.",
"rewatch.finishedToast": "“{title}”: yeniden izleme bitti",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "Viết đánh giá cho mùa này", 'seasons.writeReview': "Viết đánh giá cho mùa này",
'seasons.finalHint': "Khi xem hết series, điểm của bạn sẽ là trung bình các mùa đã chấm.", 'seasons.finalHint': "Khi xem hết series, điểm của bạn sẽ là trung bình các mùa đã chấm.",
'seasons.finalApplied': "Trung bình các mùa bạn đã chấm.", 'seasons.finalApplied': "Trung bình các mùa bạn đã chấm.",
"rewatch.title": "Xem lại",
"rewatch.badge": "Đang xem lại",
"rewatch.views_one": "Đã xem {count} lần",
"rewatch.views_other": "Đã xem {count} lần",
"rewatch.added": "“{title}”: đã thêm lần xem lại",
"rewatch.add": "Thêm",
"rewatch.finished": "Đã xem lại xong, giờ đã có trong lịch sử của bạn.",
"rewatch.since": "bắt đầu ngày {date}",
"rewatch.progress": "Đã xem lại {seen} / {total} tập",
"rewatch.trackingHint": "Các tập bạn đánh dấu bây giờ được tính cho lần xem lại này. Lần xem đầu, điểm và đánh giá của bạn vẫn giữ nguyên.",
"rewatch.markDone": "Hoàn tất ngay",
"rewatch.stop": "Dừng",
"rewatch.stopped": "“{title}”: đã dừng xem lại",
"rewatch.start": "Bắt đầu xem lại",
"rewatch.startHint": "Tiến độ bắt đầu lại từ tập 1, không ảnh hưởng lần xem đầu.",
"rewatch.alreadyDone": "Đã xem lại rồi? Thêm ngày",
"rewatch.historyEmpty": "Chưa có lần xem lại: dùng “Xem lại” ở trên.",
"rewatch.finishedToast": "“{title}”: đã xem lại xong",
} }
export default dict export default dict
+18
View File
@@ -1347,6 +1347,24 @@ const dict: Translations = {
'seasons.writeReview': "为这一季写评价", 'seasons.writeReview': "为这一季写评价",
'seasons.finalHint': "整部剧看完后,你的评分将是已评分各季的平均值。", 'seasons.finalHint': "整部剧看完后,你的评分将是已评分各季的平均值。",
'seasons.finalApplied': "已评分各季的平均值。", 'seasons.finalApplied': "已评分各季的平均值。",
"rewatch.title": "重看",
"rewatch.badge": "重看中",
"rewatch.views_one": "看过 {count} 次",
"rewatch.views_other": "看过 {count} 次",
"rewatch.added": "《{title}》:已添加重看",
"rewatch.add": "添加",
"rewatch.finished": "重看完成,已加入你的记录。",
"rewatch.since": "开始于 {date}",
"rewatch.progress": "已重看 {seen} / {total} 集",
"rewatch.trackingHint": "现在勾选的剧集计入这次重看。你的首次观看、评分和评论保持不变。",
"rewatch.markDone": "立即完成",
"rewatch.stop": "停止",
"rewatch.stopped": "《{title}》:已停止重看",
"rewatch.start": "开始重看",
"rewatch.startHint": "进度从第 1 集重新开始,不影响首次观看。",
"rewatch.alreadyDone": "已经重看过?添加日期",
"rewatch.historyEmpty": "还没有重看记录:使用上方的“重看”。",
"rewatch.finishedToast": "《{title}》:重看完成",
} }
export default dict export default dict
+2
View File
@@ -21,6 +21,7 @@ import {
import { normalizeText, todayISO, uid } from './utils' import { normalizeText, todayISO, uid } from './utils'
import { normalizeChallenges, normalizeEpisodeLog } from './challenges' import { normalizeChallenges, normalizeEpisodeLog } from './challenges'
import { normalizeSeasonRatings } from './seasons' import { normalizeSeasonRatings } from './seasons'
import { normalizeRewatch } from './rewatch'
const TYPES = new Set<string>(MEDIA_TYPES.map((t) => t.value)) const TYPES = new Set<string>(MEDIA_TYPES.map((t) => t.value))
const STATUS_SET = new Set<string>(STATUSES.map((s) => s.value)) const STATUS_SET = new Set<string>(STATUSES.map((s) => s.value))
@@ -133,6 +134,7 @@ export function normalizeItem(raw: unknown): MediaItem | null {
tags, tags,
countries: safeCountries(r.countries), countries: safeCountries(r.countries),
rewatchDates: safeDates(r.rewatchDates), rewatchDates: safeDates(r.rewatchDates),
rewatch: normalizeRewatch(r.rewatch),
seasonRatings: normalizeSeasonRatings(r.seasonRatings), seasonRatings: normalizeSeasonRatings(r.seasonRatings),
episodeLog: normalizeEpisodeLog(r.episodeLog), episodeLog: normalizeEpisodeLog(r.episodeLog),
publicRating: (() => { publicRating: (() => {
+82
View File
@@ -0,0 +1,82 @@
import type { MediaInput, MediaItem, Rewatch } from '../types'
import { TYPE_BY_VALUE } from './constants'
import { episodeCap, seasonPosition } from './franchise'
import { safeDay } from './security'
import { todayISO } from './utils'
/**
* Revisionnage : revoir un titre déjà terminé.
* - Film (ou format unique) : on ajoute simplement une date dans `rewatchDates`.
* - Série : on lance un revisionnage (`rewatch`) qui a sa propre progression d'épisodes.
* Le premier visionnage reste intact (statut « Terminé », dates, note, notes de saison) ;
* au dernier épisode, le revisionnage se termine et sa date rejoint `rewatchDates`.
*/
/** Nombre maximal de revisionnages retenus par fiche. */
export const MAX_REWATCHES = 200
/** Fiche dont on peut suivre un revisionnage épisode par épisode. */
export const canTrackRewatch = (item: Pick<MediaItem, 'type' | 'status'> & Partial<Pick<MediaItem, 'seasons' | 'episodesTotal'>>) =>
item.status === 'termine' && TYPE_BY_VALUE[item.type].episodic && !!episodeCap(item as MediaItem)
export const isRewatching = (item: Pick<MediaItem, 'rewatch'>): item is MediaItem & { rewatch: Rewatch } => !!item.rewatch
/** Nombre total de visionnages (premier + revisionnages terminés). */
export const viewCount = (item: Pick<MediaItem, 'status' | 'rewatchDates'>) => (item.status === 'termine' ? 1 : 0) + (item.rewatchDates?.length ?? 0)
/**
* La fiche « telle qu'on la regarde en ce moment » : pendant un revisionnage, la progression affichée
* (Reprendre, +1, liste d'épisodes) est celle du revisionnage. Hors revisionnage, la fiche est inchangée.
*/
export function progressView<T extends MediaItem>(item: T): T {
if (!item.rewatch) return item
const episodesWatched = item.rewatch.episodes
const season = item.seasons ? seasonPosition({ ...item, episodesWatched, season: undefined })?.season : item.season
return { ...item, episodesWatched, season, status: 'en_cours' }
}
/** Ajout d'une date de revisionnage (film, ou série revue d'un coup). */
export function addRewatchDate(item: Pick<MediaItem, 'rewatchDates'>, date = todayISO()): Partial<MediaInput> {
// Une date par jour au plus (comme à la synchro)
const dates = [...new Set([...(item.rewatchDates ?? []), date])].sort()
return { rewatchDates: dates.slice(-MAX_REWATCHES) }
}
/** Démarre un revisionnage de série (progression repartie à zéro). */
export const startRewatch = (): Partial<MediaInput> => ({ rewatch: { startDate: todayISO(), episodes: 0 } })
/** Abandonne le revisionnage en cours (rien n'est ajouté à l'historique). */
export const stopRewatch = (): Partial<MediaInput> => ({ rewatch: undefined })
/**
* Nouvelle progression du revisionnage. Au dernier épisode, il est terminé :
* la date du jour rejoint l'historique et la fiche redevient simplement « Terminé ».
*/
export function rewatchEpisodesPatch(item: MediaItem, n: number): { patch: Partial<MediaInput>; finished: boolean } {
if (!item.rewatch) return { patch: {}, finished: false }
const cap = episodeCap(item)
const episodes = Math.max(0, cap ? Math.min(n, cap) : n)
if (cap && episodes >= cap) return { patch: { rewatch: undefined, ...addRewatchDate(item) }, finished: true }
return { patch: { rewatch: { ...item.rewatch, episodes } }, finished: false }
}
/** Épisodes vus en plus pendant un revisionnage (pour le journal des défis). */
export function rewatchEpisodeDelta(current: MediaItem, next: MediaItem): number {
const before = current.rewatch?.episodes ?? 0
if (next.rewatch) return next.rewatch.episodes - before
// Revisionnage terminé : les derniers épisodes jusqu'à la fin comptent
if (current.rewatch && (next.rewatchDates?.length ?? 0) > (current.rewatchDates?.length ?? 0)) {
const cap = episodeCap(current)
return cap ? Math.max(0, cap - before) : 0
}
return 0
}
/** Nettoyage (sauvegarde, synchro). */
export function normalizeRewatch(v: unknown): Rewatch | undefined {
if (!v || typeof v !== 'object' || Array.isArray(v)) return undefined
const r = v as Record<string, unknown>
const startDate = safeDay(r.startDate)
const episodes = typeof r.episodes === 'number' && Number.isFinite(r.episodes) ? Math.max(0, Math.min(100000, Math.floor(r.episodes))) : 0
return startDate ? { startDate, episodes } : undefined
}
+20 -2
View File
@@ -3,10 +3,15 @@ import type { MediaItem, MediaType, WatchStatus } from '../types'
import { episodeCap } from './franchise' import { episodeCap } from './franchise'
import { DEFAULT_FILM_MINUTES, MEDIA_TYPES, STATUSES, TYPE_BY_VALUE } from './constants' import { DEFAULT_FILM_MINUTES, MEDIA_TYPES, STATUSES, TYPE_BY_VALUE } from './constants'
/** Temps estimé (minutes) passé sur une fiche. */ /** Temps estimé (minutes) passé sur une fiche, revisionnages compris. */
export function watchMinutes(item: MediaItem): number { export function watchMinutes(item: MediaItem): number {
const epMin = item.episodeDuration || TYPE_BY_VALUE[item.type].episodeMinutes
if (item.type === 'film') return item.status === 'termine' ? (item.duration || DEFAULT_FILM_MINUTES) * (1 + (item.rewatchDates?.length ?? 0)) : 0 if (item.type === 'film') return item.status === 'termine' ? (item.duration || DEFAULT_FILM_MINUTES) * (1 + (item.rewatchDates?.length ?? 0)) : 0
return firstViewMinutes(item) + rewatchMinutes(item)
}
/** Premier visionnage seul. */
function firstViewMinutes(item: MediaItem): number {
const epMin = item.episodeDuration || TYPE_BY_VALUE[item.type].episodeMinutes
if (item.episodesWatched > 0) return item.episodesWatched * epMin if (item.episodesWatched > 0) return item.episodesWatched * epMin
if (item.status === 'termine') { if (item.status === 'termine') {
const cap = episodeCap(item) const cap = episodeCap(item)
@@ -15,6 +20,19 @@ export function watchMinutes(item: MediaItem): number {
return 0 return 0
} }
/** Durée d'un visionnage complet (un film, ou tous les épisodes d'une série). */
export function oneViewMinutes(item: MediaItem): number {
if (!TYPE_BY_VALUE[item.type].episodic) return item.duration || DEFAULT_FILM_MINUTES
const cap = episodeCap(item)
return cap ? cap * (item.episodeDuration || TYPE_BY_VALUE[item.type].episodeMinutes) : 0
}
/** Temps passé à revoir le titre : revisionnages terminés + épisodes du revisionnage en cours. */
export function rewatchMinutes(item: MediaItem): number {
const epMin = item.episodeDuration || TYPE_BY_VALUE[item.type].episodeMinutes
return (item.rewatchDates?.length ?? 0) * oneViewMinutes(item) + (item.rewatch?.episodes ?? 0) * epMin
}
export interface Count { export interface Count {
label: string label: string
value: number value: number
+3 -1
View File
@@ -10,6 +10,7 @@ import TopFive from '../components/TopFive'
import ChallengesCard from '../components/challenges/ChallengesCard' import ChallengesCard from '../components/challenges/ChallengesCard'
import Recommendations from '../components/Recommendations' import Recommendations from '../components/Recommendations'
import HomeHero, { ContinueCard } from '../components/HomeHero' import HomeHero, { ContinueCard } from '../components/HomeHero'
import { progressView } from '../lib/rewatch'
import type { Tab } from '../components/BottomNav' import type { Tab } from '../components/BottomNav'
import { EmptyState, LinkArrow, PageHeader, SectionTitle, StatTile } from '../components/ui' import { EmptyState, LinkArrow, PageHeader, SectionTitle, StatTile } from '../components/ui'
import { CACHE_EVENT, isCaughtUp, loadAiring, needsCheck, refreshAiring, saveAiring, trackable } from '../lib/airing' import { CACHE_EVENT, isCaughtUp, loadAiring, needsCheck, refreshAiring, saveAiring, trackable } from '../lib/airing'
@@ -138,7 +139,8 @@ export default function HomePage({ onOpen, onAdd, onNavigate, onRoulette, onCale
// Pendant la vérification, une série suivie dont on ne connaît pas encore les sorties reste masquée : // Pendant la vérification, une série suivie dont on ne connaît pas encore les sorties reste masquée :
// sinon elle s'affichait puis disparaissait quelques secondes après (une fois vue « à jour »). // sinon elle s'affichait puis disparaissait quelques secondes après (une fois vue « à jour »).
const unknownWhileChecking = (i: MediaItem) => (checkingAiring || loading) && !airing[i.id] && trackable([i]).length > 0 const unknownWhileChecking = (i: MediaItem) => (checkingAiring || loading) && !airing[i.id] && trackable([i]).length > 0
const inProgress = items.filter((i) => i.status === 'en_cours' && !isCaughtUp(i, airing) && !unknownWhileChecking(i)) // Un revisionnage en cours apparaît comme une série en cours (avec sa propre progression)
const inProgress = items.map(progressView).filter((i) => i.status === 'en_cours' && !isCaughtUp(i, airing) && !unknownWhileChecking(i))
// Bannière : ce que je regarde en ce moment (le plus récemment touché), sinon le prochain « à voir » // Bannière : ce que je regarde en ce moment (le plus récemment touché), sinon le prochain « à voir »
const byRecent = [...inProgress].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt)) const byRecent = [...inProgress].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt))
const firstToWatch = items.find((i) => i.status === 'a_voir') const firstToWatch = items.find((i) => i.status === 'a_voir')
+10 -1
View File
@@ -19,6 +19,7 @@ import { uid } from './lib/utils'
import { episodeCap } from './lib/franchise' import { episodeCap } from './lib/franchise'
import { airedCount } from './lib/airing' import { airedCount } from './lib/airing'
import { logEpisodes } from './lib/challenges' import { logEpisodes } from './lib/challenges'
import { rewatchEpisodeDelta, rewatchEpisodesPatch } from './lib/rewatch'
// Clés propres à l'espace actif (compte connecté, ou appareil sans compte) // Clés propres à l'espace actif (compte connecté, ou appareil sans compte)
const settingsKey = () => scopedKey('settings') const settingsKey = () => scopedKey('settings')
@@ -291,8 +292,10 @@ export function MediaProvider({
const avg = seasonsAverage(next.seasonRatings, settingsRef.current.ratingScale) const avg = seasonsAverage(next.seasonRatings, settingsRef.current.ratingScale)
if (avg != null) next.rating = avg if (avg != null) next.rating = avg
} }
// Un revisionnage n'existe que sur un titre terminé
if (next.rewatch && next.status !== 'termine') delete next.rewatch
// Défis : on retient le jour où des épisodes sont cochés (ou décochés) // Défis : on retient le jour où des épisodes sont cochés (ou décochés)
const delta = (patch.episodesWatched ?? current.episodesWatched) - current.episodesWatched const delta = (patch.episodesWatched ?? current.episodesWatched) - current.episodesWatched + rewatchEpisodeDelta(current, next)
if (delta) next.episodeLog = logEpisodes(current.episodeLog, delta) if (delta) next.episodeLog = logEpisodes(current.episodeLog, delta)
await save(next) await save(next)
}, },
@@ -358,6 +361,12 @@ export function MediaProvider({
async (id: string, delta = 1) => { async (id: string, delta = 1) => {
const item = itemsRef.current.find((i) => i.id === id) const item = itemsRef.current.find((i) => i.id === id)
if (!item) return if (!item) return
// Revisionnage : on avance sa propre progression (le premier visionnage ne bouge pas)
if (item.rewatch) {
const { patch } = rewatchEpisodesPatch(item, item.rewatch.episodes + delta)
await update(id, patch)
return undefined
}
let next = Math.max(0, item.episodesWatched + delta) let next = Math.max(0, item.episodesWatched + delta)
const cap = episodeCap(item) const cap = episodeCap(item)
if (cap) next = Math.min(next, cap) if (cap) next = Math.min(next, cap)
+8
View File
@@ -57,6 +57,8 @@ export interface MediaItem {
countries?: string[] countries?: string[]
/** Dates de revisionnage (AAAA-MM-JJ), en plus du premier visionnage. */ /** Dates de revisionnage (AAAA-MM-JJ), en plus du premier visionnage. */
rewatchDates?: string[] rewatchDates?: string[]
/** Revisionnage de série en cours : sa propre progression, le premier visionnage reste intact. */
rewatch?: Rewatch
/** Note moyenne du public sur 10 (TMDB ou AniList). */ /** Note moyenne du public sur 10 (TMDB ou AniList). */
publicRating?: number publicRating?: number
/** Notes et avis par saison (« 1 », « 2 »…), pour les séries de plusieurs saisons. */ /** Notes et avis par saison (« 1 », « 2 »…), pour les séries de plusieurs saisons. */
@@ -68,6 +70,12 @@ export interface MediaItem {
updatedAt: string // ISO updatedAt: string // ISO
} }
/** Revisionnage en cours (séries) : commencé le…, épisodes revus. */
export interface Rewatch {
startDate: string
episodes: number
}
/** Note (sur 10) et avis d'une saison. */ /** Note (sur 10) et avis d'une saison. */
export interface SeasonRating { export interface SeasonRating {
rating?: number rating?: number