diff --git a/src/components/Disagreements.tsx b/src/components/Disagreements.tsx deleted file mode 100644 index 9c603ff..0000000 --- a/src/components/Disagreements.tsx +++ /dev/null @@ -1,143 +0,0 @@ -import { t } from '../i18n' -import { Loader2, RefreshCw } from 'lucide-react' -import { useMemo, useState } from 'react' -import { fetchPublicRatings, missingPublic } from '../lib/publicRatings' -import { cx, formatRating } from '../lib/utils' -import { useMedia } from '../store' -import type { MediaItem, RatingScale } from '../types' -import Poster from './Poster' -import { SectionTitle } from './ui' - -/** Écart signé, arrondi au dixième dans l'échelle choisie (« 0 » plutôt que « +0,0 »). */ -const signed = (v: number, scale: RatingScale) => { - const r = Math.round((scale === '5' ? v / 2 : v) * 10) / 10 - if (r === 0) return '0' - return `${r > 0 ? '+' : '−'}${String(Math.abs(r)).replace('.', t('common.decimalSep'))}` -} - -function Row({ item, scale }: { item: MediaItem; scale: RatingScale }) { - const gap = item.rating! - item.publicRating! - // barre centrée : moitié gauche = moins aimé, moitié droite = plus aimé (écart max affiché : 5 points /10) - const width = Math.min(50, (Math.abs(gap) / 5) * 50) - return ( -
{item.title}
-- {t('public.me')} {formatRating(item.rating, scale)} · {t('public.label')} {formatRating(item.publicRating, scale)} -
-{message}
} - - {compared.length === 0 ? ( -- {missing > 0 - ? t('public.hintFetch') - : settings.tmdbKey - ? t('public.hintNone') - : t('public.hintKey')} -
- ) : ( - <> -{t('public.allAgree')}
} - > - )} - > - ) -} diff --git a/src/lib/publicRatings.ts b/src/lib/publicRatings.ts deleted file mode 100644 index 6f69084..0000000 --- a/src/lib/publicRatings.ts +++ /dev/null @@ -1,90 +0,0 @@ -import type { MediaInput, MediaItem } from '../types' -import { getAniListPublicRatings, getTmdbPublicRating } from './catalogApi' -import { isSafeExternalId, readStorage } from './security' - -/** - * Récupère la note moyenne du public (TMDB / AniList) pour les fiches qui n'en ont pas. - * Les titres sans note fiable (trop peu de votes) sont mémorisés pour ne pas être redemandés à chaque fois. - */ - -const CHECKED_KEY = 'azuucine:public-checked' -const RECHECK_MS = 30 * 24 * 3600 * 1000 - -function loadChecked(): Record{item.title}
-{caption}
-Soon
- {t('stats.nonStopPre')} - {days >= 1 ? t('stats.days', { count: Math.round(days) }) : formatDuration(s.totalMinutes)} - {t('stats.nonStopPost')} - {' · '} - {t('stats.finishedN', { count: s.completed })} · {t('stats.episodesN', { count: s.episodesWatched })} -
-{t('stats.noTime')}
- )} - -- {new Date(`${shownMonth.key}-15T12:00:00`).toLocaleDateString(locale(), { month: 'long', year: 'numeric' })} - - {' · '} - {t('stats.monthFinished', { count: shownMonth.count })} · {formatDuration(shownMonth.minutes)} - -
-- {t('stats.busiest')} {new Date(`${busiest.key}-15T12:00:00`).toLocaleDateString(locale(), { month: 'long', year: 'numeric' })} -
- )} -{t('stats.noRecords')}
} -{item.title}
-
-
- {t('account.nTitles', { count: shownRating.value })} - {t('stats.ratedAs', { count: shownRating.value, rating: `${shownRating.label}${scale === '5' ? ' ★' : '/10'}` })} -
-{t('stats.noRatings')}
- )} - -{t('stats.noGenres')}
- )} - -- {geo.list.length === 0 ? t('stats.noCountryLegacy', { count: geo.missing }) : t('stats.noCountry', { count: geo.missing })} -
- )} - -- {t('stats.footnote')} -
> ) }