Notes en étoiles uniquement : plus d'échelle sur 10
- Réglage « Notation » retiré, ainsi que le curseur sur 10 et l'affichage « /10 » (fiche, cartes, Top 5, stats, filtres, carte de partage) : tout s'affiche sur 5 étoiles - Les notes restent stockées comme avant (sur 10 en interne) : rien ne change pour les notes existantes - Réglage ratingScale retiré des réglages synchronisés et des sauvegardes ; textes inutiles retirés (18 langues) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
40 files changed
+61
-214
No files matched your search
+6
-6
@@ -35,7 +35,7 @@ function persistLists(lists: CustomList[]) {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
const DEFAULT_SETTINGS: Settings = { ratingScale: '5', topCategories: ALL_TOP_CATEGORIES, accentColor: '#f0a63a', themeMode: 'auto' }
|
||||
const DEFAULT_SETTINGS: Settings = { topCategories: ALL_TOP_CATEGORIES, accentColor: '#f0a63a', themeMode: 'auto' }
|
||||
|
||||
/** Relit les réglages en ne gardant que des valeurs valides (le localStorage peut avoir été modifié). */
|
||||
function loadSettings(): Settings {
|
||||
@@ -242,9 +242,9 @@ export function MediaProvider({
|
||||
getLists: () => listsRef.current,
|
||||
applyLists: (next) => setLists(() => next, true),
|
||||
getSettings: () => {
|
||||
const { ratingScale, topCategories, accentColor, themeMode, statsHiddenMonths } = settingsRef.current
|
||||
const { topCategories, accentColor, themeMode, statsHiddenMonths } = settingsRef.current
|
||||
// Mois masqués : liste vide plutôt qu'absente, sinon « tout réafficher » ne partirait jamais au serveur
|
||||
return { ratingScale, topCategories, accentColor, themeMode, statsHiddenMonths: statsHiddenMonths ?? [] }
|
||||
return { topCategories, accentColor, themeMode, statsHiddenMonths: statsHiddenMonths ?? [] }
|
||||
},
|
||||
applySettings: (patch) => updateSettingsRef.current(patch, true),
|
||||
itemsChanged: () => void reloadItems().catch(() => {}),
|
||||
@@ -285,7 +285,7 @@ export function MediaProvider({
|
||||
}, [settings.themeMode])
|
||||
|
||||
const updateSettings = useCallback((patch: Partial<Settings>, silent = false) => {
|
||||
if (!silent && syncRef.current && ('ratingScale' in patch || 'topCategories' in patch || 'accentColor' in patch || 'themeMode' in patch || 'statsHiddenMonths' in patch)) syncRef.current.markSettings()
|
||||
if (!silent && syncRef.current && ('topCategories' in patch || 'accentColor' in patch || 'themeMode' in patch || 'statsHiddenMonths' in patch)) syncRef.current.markSettings()
|
||||
setSettings((prev) => {
|
||||
const next = { ...prev, ...patch }
|
||||
try {
|
||||
@@ -325,7 +325,7 @@ export function MediaProvider({
|
||||
const raw = { ...current, ...patch, updatedAt: new Date().toISOString() }
|
||||
// Notes de saison : série entièrement vue → la note finale est la moyenne des saisons notées
|
||||
if (('seasonRatings' in patch || patch.status === 'termine') && raw.status === 'termine' && raw.seasonRatings) {
|
||||
const avg = seasonsAverage(raw.seasonRatings, settingsRef.current.ratingScale)
|
||||
const avg = seasonsAverage(raw.seasonRatings)
|
||||
if (avg != null) raw.rating = avg
|
||||
}
|
||||
// Un revisionnage n'existe que sur un titre terminé
|
||||
@@ -574,7 +574,7 @@ export function MediaProvider({
|
||||
const current = settingsRef.current
|
||||
const merged = oldSettings
|
||||
const patch: Partial<Settings> = {}
|
||||
for (const k of ['ratingScale', 'topCategories', 'accentColor', 'themeMode'] as const) {
|
||||
for (const k of ['topCategories', 'accentColor', 'themeMode'] as const) {
|
||||
if (mine[k] === undefined && merged[k] !== undefined) Object.assign(patch, { [k]: merged[k] })
|
||||
}
|
||||
if (oldSettings.statsHiddenMonths?.length) patch.statsHiddenMonths = [...new Set([...(current.statsHiddenMonths ?? []), ...oldSettings.statsHiddenMonths])].sort()
|
||||
|
||||
Reference in new issue
Block a user