From 94c27739b2903b60e03da2e9c2f677b0938fe29e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 15:16:32 +0000 Subject: [PATCH] =?UTF-8?q?Biblioth=C3=A8que=20:=20tags=20perso,=20actions?= =?UTF-8?q?=20group=C3=A9es=20et=20=C2=AB=20Annuler=20=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Tags personnels libres sur chaque titre (fiche → Mon suivi), affichés discrètement dans la fiche, filtre par tag dans le catalogue, suggestions = tags déjà utilisés. Synchronisés avec la fiche (JSON), inclus dans l'export/import (et repris des tags de l'ancienne appli). Privés : retirés par public_item (migration) et côté client. - Actions groupées dans le catalogue : appui long (mobile), case au survol (ordinateur) ou bouton « Sélectionner » ; tout sélectionner, compteur ; statut, listes (ajout / retrait), tag (ajout / retrait), suppression avec confirmation. Échap / retour quittent. - Toast global accessible (role=status) avec « Annuler » (~6 s) après suppression, changement de statut, retrait d'une liste, actions groupées. La restauration remet la fiche à l'identique avec un updatedAt plus récent que la suppression : la synchro LWW recrée bien la fiche côté serveur. - Store : updateMany, removeMany, restore. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe --- src/App.tsx | 3 + src/components/ListsView.tsx | 4 +- src/components/TagInput.tsx | 8 +- src/components/Toast.tsx | 122 ++++++++++ src/components/library/SelectableCard.tsx | 101 ++++++++ src/components/library/SelectionBar.tsx | 219 ++++++++++++++++++ src/components/library/useLibraryActions.ts | 98 ++++++++ src/components/title/TitleSheet.tsx | 54 ++++- src/i18n/locales/ar.ts | 81 +++++++ src/i18n/locales/de.ts | 48 ++++ src/i18n/locales/en.ts | 48 ++++ src/i18n/locales/es.ts | 48 ++++ src/i18n/locales/fr.ts | 48 ++++ src/i18n/locales/hi.ts | 48 ++++ src/i18n/locales/id.ts | 48 ++++ src/i18n/locales/it.ts | 48 ++++ src/i18n/locales/ja.ts | 48 ++++ src/i18n/locales/ko.ts | 48 ++++ src/i18n/locales/nl.ts | 48 ++++ src/i18n/locales/pl.ts | 70 ++++++ src/i18n/locales/pt.ts | 48 ++++ src/i18n/locales/ru.ts | 70 ++++++ src/i18n/locales/th.ts | 48 ++++ src/i18n/locales/tr.ts | 48 ++++ src/i18n/locales/vi.ts | 48 ++++ src/i18n/locales/zh.ts | 48 ++++ src/lib/backup.ts | 19 +- src/lib/bulk.ts | 43 ++++ src/lib/cloud/social.ts | 14 +- src/lib/legacyImport.ts | 4 +- src/lib/security.ts | 2 + src/pages/CatalogPage.tsx | 95 +++++++- src/store.tsx | 64 ++++- src/types.ts | 2 + .../20261009110000_private_tags.sql | 24 ++ 35 files changed, 1795 insertions(+), 22 deletions(-) create mode 100644 src/components/Toast.tsx create mode 100644 src/components/library/SelectableCard.tsx create mode 100644 src/components/library/SelectionBar.tsx create mode 100644 src/components/library/useLibraryActions.ts create mode 100644 src/lib/bulk.ts create mode 100644 supabase/migrations/20261009110000_private_tags.sql diff --git a/src/App.tsx b/src/App.tsx index 01a12ce..6c9bb88 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,5 @@ import { SocialProvider } from './components/social/SocialProvider' +import { ToastProvider } from './components/Toast' import { useEffect, useState } from 'react' import BottomNav, { type Tab } from './components/BottomNav' import SideNav from './components/SideNav' @@ -67,6 +68,7 @@ export default function App() { } return ( +
@@ -116,5 +118,6 @@ export default function App() { )}
+
) } diff --git a/src/components/ListsView.tsx b/src/components/ListsView.tsx index 37500aa..5926494 100644 --- a/src/components/ListsView.tsx +++ b/src/components/ListsView.tsx @@ -9,6 +9,7 @@ import ConfirmDialog from './ConfirmDialog' import { MediaCard } from './MediaCard' import Poster from './Poster' import { EmptyState } from './ui' +import { useLibraryActions } from './library/useLibraryActions' /** Mosaïque 2×2 des premières affiches d'une liste. */ function Mosaic({ items }: { items: MediaItem[] }) { @@ -60,6 +61,7 @@ export function NewListForm({ onCreated, autoFocus }: { onCreated?: (list: Custo function ListDetail({ list, onBack, onOpen }: { list: CustomList; onBack: () => void; onOpen: (item: MediaItem) => void }) { const { items, renameList, deleteList, toggleInList } = useMedia() + const actions = useLibraryActions() const [renaming, setRenaming] = useState(false) const [name, setName] = useState(list.name) const [adding, setAdding] = useState(false) @@ -130,7 +132,7 @@ function ListDetail({ list, onBack, onOpen }: { list: CustomList; onBack: () => const inList = item.listIds?.includes(list.id) return (
  • - + )} + + + )} + + ) +} diff --git a/src/components/library/SelectableCard.tsx b/src/components/library/SelectableCard.tsx new file mode 100644 index 0000000..103b4e1 --- /dev/null +++ b/src/components/library/SelectableCard.tsx @@ -0,0 +1,101 @@ +import { t } from '../../i18n' +import { Check } from 'lucide-react' +import { useRef, type ReactNode } from 'react' +import { cx } from '../../lib/utils' + +interface Props { + title: string + selecting: boolean + selected: boolean + onToggle: () => void + /** Appui long (téléphone) ou case à cocher (ordinateur) : entre en mode sélection avec ce titre. */ + onStartSelect: () => void + children: ReactNode +} + +const LONG_PRESS_MS = 450 + +/** + * Enveloppe d'une carte du catalogue pour la sélection multiple : + * - téléphone : appui long sur la carte ; + * - ordinateur : case à cocher au survol ; + * - en mode sélection, toucher la carte la coche / décoche (au lieu d'ouvrir la fiche). + */ +export default function SelectableCard({ title, selecting, selected, onToggle, onStartSelect, children }: Props) { + const timer = useRef>(undefined) + const origin = useRef<{ x: number; y: number }>(undefined) + const fired = useRef(false) + + const cancel = () => { + clearTimeout(timer.current) + timer.current = undefined + origin.current = undefined + } + + return ( +
    { + fired.current = false + if (selecting || e.pointerType === 'mouse') return + origin.current = { x: e.clientX, y: e.clientY } + timer.current = setTimeout(() => { + fired.current = true + timer.current = undefined + navigator.vibrate?.(12) + onStartSelect() + }, LONG_PRESS_MS) + }} + onPointerMove={(e) => { + // Le doigt glisse (défilement) : ce n'est pas un appui long + if (origin.current && Math.hypot(e.clientX - origin.current.x, e.clientY - origin.current.y) > 10) cancel() + }} + onPointerUp={cancel} + onPointerCancel={cancel} + onPointerLeave={cancel} + onContextMenu={(e) => { + // Pas de menu « Enregistrer l'image » pendant l'appui long + if (fired.current || timer.current) e.preventDefault() + }} + onClickCapture={(e) => { + // Le « clic » qui suit un appui long ne doit pas ouvrir la fiche + if (fired.current) { + e.preventDefault() + e.stopPropagation() + fired.current = false + } + }} + > + {children} + + {selecting ? ( + + ) : ( + // Ordinateur : case à cocher au survol (ou au clavier) pour commencer une sélection + + )} +
    + ) +} diff --git a/src/components/library/SelectionBar.tsx b/src/components/library/SelectionBar.tsx new file mode 100644 index 0000000..38e1f71 --- /dev/null +++ b/src/components/library/SelectionBar.tsx @@ -0,0 +1,219 @@ +import { t } from '../../i18n' +import { CircleDot, ListPlus, Minus, Plus, Tag, Trash2, X } from 'lucide-react' +import { useMemo, useState, type ReactNode } from 'react' +import { useBackToClose } from '../../lib/backNav' +import { allTags, cleanTag, hasTag } from '../../lib/bulk' +import { STATUSES } from '../../lib/constants' +import { useEscape } from '../../lib/escape' +import { cx, normalizeText } from '../../lib/utils' +import { useMedia } from '../../store' +import type { MediaItem, WatchStatus } from '../../types' +import { StatusDot } from '../Badges' +import ConfirmDialog from '../ConfirmDialog' +import { NewListForm } from '../ListsView' +import { useLibraryActions } from './useLibraryActions' + +type Panel = null | 'status' | 'list' | 'tag' | 'delete' + +interface Props { + /** Fiches sélectionnées */ + selected: MediaItem[] + /** Action terminée : on quitte le mode sélection */ + onDone: () => void +} + +/** Barre d'actions groupées (en bas, à la place de la barre de navigation). */ +export default function SelectionBar({ selected, onDone }: Props) { + const actions = useLibraryActions() + const [panel, setPanel] = useState(null) + const ids = selected.map((i) => i.id) + const none = selected.length === 0 + + const run = async (fn: () => Promise) => { + setPanel(null) + await fn() + onDone() + } + + return ( + <> +
    +
    + } label={t('select.status')} onClick={() => setPanel('status')} disabled={none} /> + } label={t('select.list')} onClick={() => setPanel('list')} disabled={none} /> + } label={t('select.tag')} onClick={() => setPanel('tag')} disabled={none} /> + } label={t('common.delete')} onClick={() => setPanel('delete')} disabled={none} danger /> +
    +
    + + {panel === 'status' && ( + setPanel(null)}> + {STATUSES.map((s) => { + const already = selected.every((i) => i.status === s.value) + return ( + + ) + })} + + )} + + {panel === 'list' && setPanel(null)} run={run} />} + {panel === 'tag' && setPanel(null)} run={run} />} + + void run(() => actions.deleteItems(ids))} + onCancel={() => setPanel(null)} + /> + + ) +} + +function BarButton({ icon, label, onClick, disabled, danger }: { icon: ReactNode; label: string; onClick: () => void; disabled?: boolean; danger?: boolean }) { + return ( + + ) +} + +/** Petite feuille en bas de l'écran ; Échap ou le geste retour la ferment sans quitter la sélection. */ +function PickerSheet({ title, onClose, children }: { title: string; onClose: () => void; children: ReactNode }) { + useEscape(onClose) + useBackToClose(onClose) + return ( +
    +
    e.stopPropagation()} + > +
    +

    {title}

    + +
    + {children} +
    +
    + ) +} + +type Run = (fn: () => Promise) => Promise + +function ListPicker({ selected, onClose, run }: { selected: MediaItem[]; onClose: () => void; run: Run }) { + const { lists } = useMedia() + const actions = useLibraryActions() + const ids = selected.map((i) => i.id) + return ( + + {lists.length === 0 &&

    {t('select.noLists')}

    } +
      + {lists.map((l) => { + const inside = selected.filter((i) => i.listIds?.includes(l.id)).length + return ( +
    • +
      +

      {l.name}

      +

      {t('select.inList', { n: inside, total: selected.length })}

      +
      + + +
    • + ) + })} +
    +
    + void run(() => actions.addToList(ids, l.id, l.name))} /> +
    +
    + ) +} + +function TagPicker({ selected, onClose, run }: { selected: MediaItem[]; onClose: () => void; run: Run }) { + const { items } = useMedia() + const actions = useLibraryActions() + const ids = selected.map((i) => i.id) + const existing = useMemo(() => allTags(items), [items]) + // Tags déjà portés par au moins une fiche sélectionnée (pour les retirer) + const present = useMemo(() => allTags(selected), [selected]) + const [text, setText] = useState('') + const q = normalizeText(text) + const suggestions = existing.filter((tag) => !selected.every((i) => hasTag(i, tag)) && (!q || normalizeText(tag).includes(q))).slice(0, 16) + const add = (raw: string) => { + const tag = cleanTag(raw, existing) + if (tag) void run(() => actions.addTag(ids, tag)) + } + + return ( + +
    { + e.preventDefault() + add(text) + }} + > + setText(e.target.value)} placeholder={t('tags.placeholder')} maxLength={40} autoFocus enterKeyHint="done" aria-label={t('tags.label')} /> + +
    + {suggestions.length > 0 && ( +
    + {suggestions.map((tag) => ( + + ))} +
    + )} + {present.length > 0 && ( +
    + {t('select.removeTag')} +
    + {present.map((tag) => ( + + ))} +
    +
    + )} +

    {t('tags.private')}

    +
    + ) +} diff --git a/src/components/library/useLibraryActions.ts b/src/components/library/useLibraryActions.ts new file mode 100644 index 0000000..5407b71 --- /dev/null +++ b/src/components/library/useLibraryActions.ts @@ -0,0 +1,98 @@ +import { t } from '../../i18n' +import { useCallback, useMemo } from 'react' +import { STATUS_BY_VALUE } from '../../lib/constants' +import { hasTag, statusPatch } from '../../lib/bulk' +import { LIMITS } from '../../lib/security' +import { normalizeText } from '../../lib/utils' +import { useMedia } from '../../store' +import type { MediaItem, WatchStatus } from '../../types' +import { useToast } from '../Toast' + +/** + * Actions sur la bibliothèque qui proposent « Annuler » (suppression, statut, listes, tags). + * L'annulation remet les fiches exactement comme avant (voir `restore` dans le store). + */ +export function useLibraryActions() { + const { items, lists, updateMany, removeMany, restore } = useMedia() + const toast = useToast() + + const pick = useCallback((ids: Iterable) => { + const wanted = new Set(ids) + return items.filter((i) => wanted.has(i.id)) + }, [items]) + + const undoable = useCallback( + (message: string, snapshots: MediaItem[]) => toast.show(message, { undo: () => restore(snapshots) }), + [toast, restore], + ) + + const listName = useCallback((id: string) => lists.find((l) => l.id === id)?.name ?? '', [lists]) + + return useMemo( + () => ({ + /** Supprime des fiches (avec « Annuler »). */ + async deleteItems(ids: Iterable) { + const snapshots = pick(ids) + if (!snapshots.length) return + await removeMany(snapshots.map((i) => i.id)) + undoable( + snapshots.length === 1 ? t('toast.deleted', { title: snapshots[0].title }) : t('toast.deletedMany', { count: snapshots.length }), + snapshots, + ) + }, + + /** Change le statut (dates et épisodes suivent, comme sur la fiche). */ + async setStatus(ids: Iterable, status: WatchStatus) { + const snapshots = pick(ids).filter((i) => i.status !== status) + if (!snapshots.length) return + await updateMany(snapshots.map((i) => ({ id: i.id, patch: statusPatch(i, status) }))) + const label = STATUS_BY_VALUE[status].label + undoable( + snapshots.length === 1 ? t('toast.status', { title: snapshots[0].title, status: label }) : t('toast.statusMany', { count: snapshots.length, status: label }), + snapshots, + ) + }, + + async addToList(ids: Iterable, listId: string, name?: string) { + const snapshots = pick(ids).filter((i) => !i.listIds?.includes(listId)) + if (!snapshots.length) return + await updateMany(snapshots.map((i) => ({ id: i.id, patch: { listIds: [...(i.listIds ?? []), listId] } }))) + undoable(t('toast.addedToList', { count: snapshots.length, list: name ?? listName(listId) }), snapshots) + }, + + async removeFromList(ids: Iterable, listId: string) { + const snapshots = pick(ids).filter((i) => i.listIds?.includes(listId)) + if (!snapshots.length) return + await updateMany(snapshots.map((i) => ({ id: i.id, patch: { listIds: i.listIds!.filter((x) => x !== listId) } }))) + undoable( + snapshots.length === 1 ? t('toast.removedFromList', { title: snapshots[0].title, list: listName(listId) }) : t('toast.removedFromListMany', { count: snapshots.length, list: listName(listId) }), + snapshots, + ) + }, + + async addTag(ids: Iterable, tag: string) { + const snapshots = pick(ids).filter((i) => !hasTag(i, tag) && (i.tags?.length ?? 0) < LIMITS.tags) + if (!snapshots.length || !tag) return + await updateMany(snapshots.map((i) => ({ id: i.id, patch: { tags: [...(i.tags ?? []), tag] } }))) + undoable(t('toast.tagged', { count: snapshots.length, tag }), snapshots) + }, + + async removeTag(ids: Iterable, tag: string) { + const key = normalizeText(tag) + const snapshots = pick(ids).filter((i) => hasTag(i, tag)) + if (!snapshots.length) return + await updateMany( + snapshots.map((i) => { + const tags = i.tags!.filter((x) => normalizeText(x) !== key) + return { id: i.id, patch: { tags: tags.length ? tags : undefined } } + }), + ) + undoable(t('toast.untagged', { count: snapshots.length, tag }), snapshots) + }, + + /** « Annuler » pour un changement fait ailleurs (fiche) : remet ces copies. */ + offerUndo: undoable, + }), + [pick, removeMany, updateMany, undoable, listName], + ) +} diff --git a/src/components/title/TitleSheet.tsx b/src/components/title/TitleSheet.tsx index 70b1432..d3cd4fa 100644 --- a/src/components/title/TitleSheet.tsx +++ b/src/components/title/TitleSheet.tsx @@ -15,6 +15,9 @@ import { backdropSrcSet, tmdbSized } from '../../lib/tmdbImage' import { renderItemCard, slug } from '../../lib/shareCard' import { cx, formatDate, formatDuration, formatRating, todayISO } from '../../lib/utils' import { useMedia } from '../../store' +import { allTags, cleanTag } from '../../lib/bulk' +import { useLibraryActions } from '../library/useLibraryActions' +import TagInput from '../TagInput' import type { MediaInput, MediaItem, RatingScale, WatchStatus } from '../../types' import ConfirmDialog from '../ConfirmDialog' import EpisodeList from '../EpisodeList' @@ -43,7 +46,8 @@ interface Props { * Vu / En cours / À voir, note, coup de cœur, avis, épisodes, casting et note moyenne du public. */ export default function TitleSheet({ item: initial, seed, onClose, onGoToSettings }: Props) { - const { items, settings, add, update, remove, lists, patchMany } = useMedia() + const { items, settings, add, update, lists, patchMany } = useMedia() + const actions = useLibraryActions() const social = useSocial() useScrollLock() useEscape(onClose) @@ -183,7 +187,11 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting const cap = episodeCap(item ?? { episodesTotal: data.episodesTotal, seasons: data.seasons }) if (episodic && cap) patch.episodesWatched = cap } - void save(patch) + // Changement de statut d'un titre déjà suivi : « Annuler » remet la fiche telle quelle (dates, épisodes…) + const before = item + void save(patch).then(() => { + if (before) actions.offerUndo(t('toast.status', { title: before.title, status: STATUS_BY_VALUE[s].label }), [before]) + }) } /** @@ -254,13 +262,25 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting } } - const onDelete = async () => { + const onDelete = () => { if (!item) return setConfirmDelete(false) - await remove(item.id) + // Le message « Supprimé · Annuler » reste affiché après la fermeture de la fiche + void actions.deleteItems([item.id]) onClose() } + /** Suivi modifié ; retirer le titre d'une liste propose « Annuler ». */ + const changeTracking = (patch: Partial) => { + if (!item) return + const before = item + const removed = patch.listIds ? (before.listIds ?? []).filter((id) => !patch.listIds!.includes(id)) : [] + void update(before.id, patch).then(() => { + const list = removed.length === 1 ? lists.find((l) => l.id === removed[0]) : undefined + if (list) actions.offerUndo(t('toast.removedFromList', { title: before.title, list: list.name }), [before]) + }) + } + const heroImage = backdrop ?? extras?.backdrop const average = extras?.average ?? data.publicRating const source = externalId?.startsWith('anilist:') ? 'AniList' : externalId ? 'TMDB' : undefined @@ -324,6 +344,16 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting {t('title.inLibrary')} · {STATUS_BY_VALUE[status].label}

    )} + {/* Mes tags perso : discrets, visibles par moi seul */} + {item?.tags && item.tags.length > 0 && ( +
      + {item.tags.map((tag) => ( +
    • + #{tag} +
    • + ))} +
    + )} @@ -492,7 +522,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting )} {/* Mon suivi : dates, plateforme, listes, revisionnages */} - {item && void update(item.id, patch)} />} + {item && } @@ -685,7 +715,7 @@ function Synopsis({ text }: { text: string }) { } /** Dates, plateforme, listes et revisionnages : enregistrés dès qu'on les change. */ -function Tracking({ item, lists, onChange }: { item: MediaItem; lists: { id: string; name: string }[]; onChange: (p: Partial) => void }) { +function Tracking({ item, lists, tagSuggestions, onChange }: { item: MediaItem; lists: { id: string; name: string }[]; tagSuggestions: string[]; onChange: (p: Partial) => void }) { const [open, setOpen] = useState(false) // Plus récent en premier (la sauvegarde les range dans l'autre sens) const rewatches = [...(item.rewatchDates ?? [])].sort().reverse() @@ -737,6 +767,18 @@ function Tracking({ item, lists, onChange }: { item: MediaItem; lists: { id: str )} onChange({ listIds: [...(item.listIds ?? []), l.id] })} /> +
    + {t('tags.label')} + onChange({ tags: tags.length ? tags.slice(0, 30) : undefined })} + suggestions={tagSuggestions} + placeholder={t('tags.placeholder')} + normalize={(v) => cleanTag(v, tagSuggestions)} + showAll + /> +

    {t('tags.private')}

    +
    {t('form.rewatches')} {rewatches.length > 0 && ( diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts index f043a88..7a125d7 100644 --- a/src/i18n/locales/ar.ts +++ b/src/i18n/locales/ar.ts @@ -1035,6 +1035,87 @@ const dict: Translations = { 'sync.pending_two': "تعديلان في الانتظار", 'sync.pending_few': "{count} تعديلات في الانتظار", 'sync.pending_many': "{count} تعديلًا في الانتظار", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "وسوم شخصية", + "tags.placeholder": "مريح، هالوين، لإعادة المشاهدة مع ليا…", + "tags.private": "مرئية لك وحدك، ولا تظهر أبدًا في ملفك الشخصي.", + "tags.filter": "وسوم شخصية", + "select.start": "تحديد", + "select.exit": "إنهاء التحديد", + "select.all": "تحديد الكل", + "select.none": "إلغاء تحديد الكل", + "select.toggle": "تحديد «{title}»", + "select.actions": "إجراءات التحديد", + "select.status": "الحالة", + "select.list": "قائمة", + "select.tag": "وسم", + "select.noLists": "لا توجد قوائم بعد — أنشئ واحدة أدناه.", + "select.inList": "موجودة بالفعل: {n}/{total}", + "select.addTo": "إضافة إلى «{list}»", + "select.removeFrom": "إزالة من «{list}»", + "select.removeTag": "إزالة وسم", + "toast.undo": "تراجع", + "toast.undone": "تم التراجع", + "toast.undoFailed": "تعذّر التراجع", + "toast.deleted": "تم حذف «{title}»", + "toast.status": "«{title}»: {status}", + "toast.removedFromList": "تمت إزالة «{title}» من «{list}»", + "select.count_zero": "لم يُحدَّد أي عنوان", + "select.count_one": "تم تحديد عنوان واحد", + "select.count_two": "تم تحديد عنوانين", + "select.count_few": "تم تحديد {count} عناوين", + "select.count_many": "تم تحديد {count} عنوانًا", + "select.count_other": "تم تحديد {count} عنوان", + "select.statusTitle_one": "حالة عنوان واحد", + "select.statusTitle_two": "حالة عنوانان", + "select.statusTitle_few": "حالة {count} عناوين", + "select.statusTitle_many": "حالة {count} عنوانًا", + "select.statusTitle_other": "حالة {count} عنوان", + "select.listTitle_one": "القوائم · عنوان واحد", + "select.listTitle_two": "القوائم · عنوانان", + "select.listTitle_few": "القوائم · {count} عناوين", + "select.listTitle_many": "القوائم · {count} عنوانًا", + "select.listTitle_other": "القوائم · {count} عنوان", + "select.tagTitle_one": "وسم · عنوان واحد", + "select.tagTitle_two": "وسم · عنوانان", + "select.tagTitle_few": "وسم · {count} عناوين", + "select.tagTitle_many": "وسم · {count} عنوانًا", + "select.tagTitle_other": "وسم · {count} عنوان", + "select.deleteConfirm_one": "حذف عنوان واحد من مكتبتك؟", + "select.deleteConfirm_two": "حذف عنوانين من مكتبتك؟", + "select.deleteConfirm_few": "حذف {count} عناوين من مكتبتك؟", + "select.deleteConfirm_many": "حذف {count} عنوانًا من مكتبتك؟", + "select.deleteConfirm_other": "حذف {count} عنوان من مكتبتك؟", + "toast.deletedMany_one": "تم حذف عنوان واحد", + "toast.deletedMany_two": "تم حذف عنوانين", + "toast.deletedMany_few": "تم حذف {count} عناوين", + "toast.deletedMany_many": "تم حذف {count} عنوانًا", + "toast.deletedMany_other": "تم حذف {count} عنوان", + "toast.statusMany_one": "عنوان واحد: {status}", + "toast.statusMany_two": "عنوانان: {status}", + "toast.statusMany_few": "{count} عناوين: {status}", + "toast.statusMany_many": "{count} عنوانًا: {status}", + "toast.statusMany_other": "{count} عنوان: {status}", + "toast.addedToList_one": "تمت إضافة عنوان واحد إلى «{list}»", + "toast.addedToList_two": "تمت إضافة عنوانين إلى «{list}»", + "toast.addedToList_few": "تمت إضافة {count} عناوين إلى «{list}»", + "toast.addedToList_many": "تمت إضافة {count} عنوانًا إلى «{list}»", + "toast.addedToList_other": "تمت إضافة {count} عنوان إلى «{list}»", + "toast.removedFromListMany_one": "تمت إزالة عنوان واحد من «{list}»", + "toast.removedFromListMany_two": "تمت إزالة عنوانين من «{list}»", + "toast.removedFromListMany_few": "تمت إزالة {count} عناوين من «{list}»", + "toast.removedFromListMany_many": "تمت إزالة {count} عنوانًا من «{list}»", + "toast.removedFromListMany_other": "تمت إزالة {count} عنوان من «{list}»", + "toast.tagged_one": "تمت إضافة #{tag} إلى عنوان واحد", + "toast.tagged_two": "تمت إضافة #{tag} إلى عنوانين", + "toast.tagged_few": "تمت إضافة #{tag} إلى {count} عناوين", + "toast.tagged_many": "تمت إضافة #{tag} إلى {count} عنوانًا", + "toast.tagged_other": "تمت إضافة #{tag} إلى {count} عنوان", + "toast.untagged_one": "تمت إزالة #{tag} من عنوان واحد", + "toast.untagged_two": "تمت إزالة #{tag} من عنوانين", + "toast.untagged_few": "تمت إزالة #{tag} من {count} عناوين", + "toast.untagged_many": "تمت إزالة #{tag} من {count} عنوانًا", + "toast.untagged_other": "تمت إزالة #{tag} من {count} عنوان", } export default dict diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 27a5e64..6582bd9 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} Änderung ausstehend", 'sync.pending_other': "{count} Änderungen ausstehend", 'sync.now': "Jetzt synchronisieren", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Eigene Tags", + "tags.placeholder": "comfort, halloween, mit Lea nochmal schauen…", + "tags.private": "Nur für dich sichtbar, nie auf deinem Profil.", + "tags.filter": "Eigene Tags", + "select.start": "Auswählen", + "select.exit": "Auswahl beenden", + "select.all": "Alle auswählen", + "select.none": "Auswahl aufheben", + "select.toggle": "„{title}“ auswählen", + "select.actions": "Aktionen für die Auswahl", + "select.status": "Status", + "select.list": "Liste", + "select.tag": "Tag", + "select.noLists": "Noch keine Listen – erstelle unten eine.", + "select.inList": "Schon drin: {n}/{total}", + "select.addTo": "Zu „{list}“ hinzufügen", + "select.removeFrom": "Aus „{list}“ entfernen", + "select.removeTag": "Tag entfernen", + "toast.undo": "Rückgängig", + "toast.undone": "Rückgängig gemacht", + "toast.undoFailed": "Rückgängig machen fehlgeschlagen", + "toast.deleted": "„{title}“ gelöscht", + "toast.status": "„{title}“ → {status}", + "toast.removedFromList": "„{title}“ aus „{list}“ entfernt", + "select.count_zero": "Kein Titel ausgewählt", + "select.count_one": "{count} ausgewählt", + "select.count_other": "{count} ausgewählt", + "select.statusTitle_one": "Status von {count} Titel", + "select.statusTitle_other": "Status von {count} Titeln", + "select.listTitle_one": "Listen · {count} Titel", + "select.listTitle_other": "Listen · {count} Titel", + "select.tagTitle_one": "Tag · {count} Titel", + "select.tagTitle_other": "Tag · {count} Titel", + "select.deleteConfirm_one": "{count} Titel aus deiner Bibliothek löschen?", + "select.deleteConfirm_other": "{count} Titel aus deiner Bibliothek löschen?", + "toast.deletedMany_one": "{count} Titel gelöscht", + "toast.deletedMany_other": "{count} Titel gelöscht", + "toast.statusMany_one": "{count} Titel → {status}", + "toast.statusMany_other": "{count} Titel → {status}", + "toast.addedToList_one": "{count} Titel zu „{list}“ hinzugefügt", + "toast.addedToList_other": "{count} Titel zu „{list}“ hinzugefügt", + "toast.removedFromListMany_one": "{count} Titel aus „{list}“ entfernt", + "toast.removedFromListMany_other": "{count} Titel aus „{list}“ entfernt", + "toast.tagged_one": "#{tag} zu {count} Titel hinzugefügt", + "toast.tagged_other": "#{tag} zu {count} Titeln hinzugefügt", + "toast.untagged_one": "#{tag} von {count} Titel entfernt", + "toast.untagged_other": "#{tag} von {count} Titeln entfernt", } export default dict diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 485d651..b5d9196 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} change waiting", 'sync.pending_other': "{count} changes waiting", 'sync.now': "Sync now", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Personal tags", + "tags.placeholder": "comfort, halloween, rewatch with Lea…", + "tags.private": "Only you can see them, never on your profile.", + "tags.filter": "Personal tags", + "select.start": "Select", + "select.exit": "Exit selection", + "select.all": "Select all", + "select.none": "Deselect all", + "select.toggle": "Select “{title}”", + "select.actions": "Selection actions", + "select.status": "Status", + "select.list": "List", + "select.tag": "Tag", + "select.noLists": "No lists yet — create one below.", + "select.inList": "Already in: {n}/{total}", + "select.addTo": "Add to “{list}”", + "select.removeFrom": "Remove from “{list}”", + "select.removeTag": "Remove a tag", + "toast.undo": "Undo", + "toast.undone": "Undone", + "toast.undoFailed": "Couldn’t undo", + "toast.deleted": "“{title}” deleted", + "toast.status": "“{title}” → {status}", + "toast.removedFromList": "“{title}” removed from “{list}”", + "select.count_zero": "No titles selected", + "select.count_one": "{count} selected", + "select.count_other": "{count} selected", + "select.statusTitle_one": "Status of {count} title", + "select.statusTitle_other": "Status of {count} titles", + "select.listTitle_one": "Lists · {count} title", + "select.listTitle_other": "Lists · {count} titles", + "select.tagTitle_one": "Tag · {count} title", + "select.tagTitle_other": "Tag · {count} titles", + "select.deleteConfirm_one": "Delete {count} title from your library?", + "select.deleteConfirm_other": "Delete {count} titles from your library?", + "toast.deletedMany_one": "{count} title deleted", + "toast.deletedMany_other": "{count} titles deleted", + "toast.statusMany_one": "{count} title → {status}", + "toast.statusMany_other": "{count} titles → {status}", + "toast.addedToList_one": "{count} title added to “{list}”", + "toast.addedToList_other": "{count} titles added to “{list}”", + "toast.removedFromListMany_one": "{count} title removed from “{list}”", + "toast.removedFromListMany_other": "{count} titles removed from “{list}”", + "toast.tagged_one": "#{tag} added to {count} title", + "toast.tagged_other": "#{tag} added to {count} titles", + "toast.untagged_one": "#{tag} removed from {count} title", + "toast.untagged_other": "#{tag} removed from {count} titles", } export default dict diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 7cf4d14..7622e08 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} cambio pendiente", 'sync.pending_other': "{count} cambios pendientes", 'sync.now': "Sincronizar", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Etiquetas personales", + "tags.placeholder": "comfort, halloween, volver a ver con Lea…", + "tags.private": "Solo tú las ves, nunca en tu perfil.", + "tags.filter": "Etiquetas personales", + "select.start": "Seleccionar", + "select.exit": "Salir de la selección", + "select.all": "Seleccionar todo", + "select.none": "Deseleccionar todo", + "select.toggle": "Seleccionar «{title}»", + "select.actions": "Acciones de la selección", + "select.status": "Estado", + "select.list": "Lista", + "select.tag": "Etiqueta", + "select.noLists": "Aún no hay listas: crea una abajo.", + "select.inList": "Ya incluidos: {n}/{total}", + "select.addTo": "Añadir a «{list}»", + "select.removeFrom": "Quitar de «{list}»", + "select.removeTag": "Quitar una etiqueta", + "toast.undo": "Deshacer", + "toast.undone": "Deshecho", + "toast.undoFailed": "No se pudo deshacer", + "toast.deleted": "«{title}» eliminado", + "toast.status": "«{title}» → {status}", + "toast.removedFromList": "«{title}» quitado de «{list}»", + "select.count_zero": "Ningún título seleccionado", + "select.count_one": "{count} seleccionado", + "select.count_other": "{count} seleccionados", + "select.statusTitle_one": "Estado de {count} título", + "select.statusTitle_other": "Estado de {count} títulos", + "select.listTitle_one": "Listas · {count} título", + "select.listTitle_other": "Listas · {count} títulos", + "select.tagTitle_one": "Etiqueta · {count} título", + "select.tagTitle_other": "Etiqueta · {count} títulos", + "select.deleteConfirm_one": "¿Eliminar {count} título de tu biblioteca?", + "select.deleteConfirm_other": "¿Eliminar {count} títulos de tu biblioteca?", + "toast.deletedMany_one": "{count} título eliminado", + "toast.deletedMany_other": "{count} títulos eliminados", + "toast.statusMany_one": "{count} título → {status}", + "toast.statusMany_other": "{count} títulos → {status}", + "toast.addedToList_one": "{count} título añadido a «{list}»", + "toast.addedToList_other": "{count} títulos añadidos a «{list}»", + "toast.removedFromListMany_one": "{count} título quitado de «{list}»", + "toast.removedFromListMany_other": "{count} títulos quitados de «{list}»", + "toast.tagged_one": "#{tag} añadida a {count} título", + "toast.tagged_other": "#{tag} añadida a {count} títulos", + "toast.untagged_one": "#{tag} quitada de {count} título", + "toast.untagged_other": "#{tag} quitada de {count} títulos", } export default dict diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 1898226..8649069 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -899,6 +899,54 @@ const dict = { 'sync.pending_one': "{count} modification en attente", 'sync.pending_other': "{count} modifications en attente", 'sync.now': "Synchroniser", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Tags perso", + "tags.placeholder": "comfort, halloween, à revoir avec Léa…", + "tags.private": "Visibles par vous seul, jamais sur votre profil.", + "tags.filter": "Tags perso", + "select.start": "Sélectionner", + "select.exit": "Quitter la sélection", + "select.all": "Tout sélectionner", + "select.none": "Tout désélectionner", + "select.toggle": "Sélectionner « {title} »", + "select.actions": "Actions sur la sélection", + "select.status": "Statut", + "select.list": "Liste", + "select.tag": "Tag", + "select.noLists": "Aucune liste pour l’instant : créez-en une ci-dessous.", + "select.inList": "Déjà dedans : {n}/{total}", + "select.addTo": "Ajouter à « {list} »", + "select.removeFrom": "Retirer de « {list} »", + "select.removeTag": "Retirer un tag", + "toast.undo": "Annuler", + "toast.undone": "Action annulée", + "toast.undoFailed": "Impossible d’annuler", + "toast.deleted": "« {title} » supprimé", + "toast.status": "« {title} » → {status}", + "toast.removedFromList": "« {title} » retiré de « {list} »", + "select.count_zero": "Aucun titre sélectionné", + "select.count_one": "{count} sélectionné", + "select.count_other": "{count} sélectionnés", + "select.statusTitle_one": "Statut de {count} titre", + "select.statusTitle_other": "Statut de {count} titres", + "select.listTitle_one": "Listes · {count} titre", + "select.listTitle_other": "Listes · {count} titres", + "select.tagTitle_one": "Tag · {count} titre", + "select.tagTitle_other": "Tag · {count} titres", + "select.deleteConfirm_one": "Supprimer {count} titre de votre bibliothèque ?", + "select.deleteConfirm_other": "Supprimer {count} titres de votre bibliothèque ?", + "toast.deletedMany_one": "{count} titre supprimé", + "toast.deletedMany_other": "{count} titres supprimés", + "toast.statusMany_one": "{count} titre → {status}", + "toast.statusMany_other": "{count} titres → {status}", + "toast.addedToList_one": "{count} titre ajouté à « {list} »", + "toast.addedToList_other": "{count} titres ajoutés à « {list} »", + "toast.removedFromListMany_one": "{count} titre retiré de « {list} »", + "toast.removedFromListMany_other": "{count} titres retirés de « {list} »", + "toast.tagged_one": "#{tag} ajouté à {count} titre", + "toast.tagged_other": "#{tag} ajouté à {count} titres", + "toast.untagged_one": "#{tag} retiré de {count} titre", + "toast.untagged_other": "#{tag} retiré de {count} titres", } export default dict diff --git a/src/i18n/locales/hi.ts b/src/i18n/locales/hi.ts index db825eb..28fe282 100644 --- a/src/i18n/locales/hi.ts +++ b/src/i18n/locales/hi.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} बदलाव बाकी", 'sync.pending_other': "{count} बदलाव बाकी", 'sync.now': "अभी सिंक करें", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "निजी टैग", + "tags.placeholder": "comfort, हैलोवीन, लेआ के साथ फिर देखें…", + "tags.private": "सिर्फ़ आपको दिखते हैं, प्रोफ़ाइल पर कभी नहीं।", + "tags.filter": "निजी टैग", + "select.start": "चुनें", + "select.exit": "चयन बंद करें", + "select.all": "सभी चुनें", + "select.none": "सभी का चयन हटाएँ", + "select.toggle": "“{title}” चुनें", + "select.actions": "चयन पर कार्रवाई", + "select.status": "स्थिति", + "select.list": "सूची", + "select.tag": "टैग", + "select.noLists": "अभी कोई सूची नहीं — नीचे एक बनाएँ।", + "select.inList": "पहले से शामिल: {n}/{total}", + "select.addTo": "“{list}” में जोड़ें", + "select.removeFrom": "“{list}” से हटाएँ", + "select.removeTag": "टैग हटाएँ", + "toast.undo": "पूर्ववत करें", + "toast.undone": "पूर्ववत किया गया", + "toast.undoFailed": "पूर्ववत नहीं हो सका", + "toast.deleted": "“{title}” हटाया गया", + "toast.status": "“{title}” → {status}", + "toast.removedFromList": "“{title}” को “{list}” से हटाया गया", + "select.count_zero": "कोई टाइटल नहीं चुना गया", + "select.count_one": "{count} चुना गया", + "select.count_other": "{count} चुने गए", + "select.statusTitle_one": "{count} टाइटल की स्थिति", + "select.statusTitle_other": "{count} टाइटल की स्थिति", + "select.listTitle_one": "सूचियाँ · {count} टाइटल", + "select.listTitle_other": "सूचियाँ · {count} टाइटल", + "select.tagTitle_one": "टैग · {count} टाइटल", + "select.tagTitle_other": "टैग · {count} टाइटल", + "select.deleteConfirm_one": "अपनी लाइब्रेरी से {count} टाइटल हटाएँ?", + "select.deleteConfirm_other": "अपनी लाइब्रेरी से {count} टाइटल हटाएँ?", + "toast.deletedMany_one": "{count} टाइटल हटाया गया", + "toast.deletedMany_other": "{count} टाइटल हटाए गए", + "toast.statusMany_one": "{count} टाइटल → {status}", + "toast.statusMany_other": "{count} टाइटल → {status}", + "toast.addedToList_one": "{count} टाइटल “{list}” में जोड़ा गया", + "toast.addedToList_other": "{count} टाइटल “{list}” में जोड़े गए", + "toast.removedFromListMany_one": "{count} टाइटल “{list}” से हटाया गया", + "toast.removedFromListMany_other": "{count} टाइटल “{list}” से हटाए गए", + "toast.tagged_one": "#{tag} {count} टाइटल में जोड़ा गया", + "toast.tagged_other": "#{tag} {count} टाइटल में जोड़ा गया", + "toast.untagged_one": "#{tag} {count} टाइटल से हटाया गया", + "toast.untagged_other": "#{tag} {count} टाइटल से हटाया गया", } export default dict diff --git a/src/i18n/locales/id.ts b/src/i18n/locales/id.ts index 5da9809..008cb70 100644 --- a/src/i18n/locales/id.ts +++ b/src/i18n/locales/id.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} perubahan menunggu", 'sync.pending_other': "{count} perubahan menunggu", 'sync.now': "Sinkronkan", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Tag pribadi", + "tags.placeholder": "comfort, halloween, tonton ulang bareng Lea…", + "tags.private": "Hanya terlihat olehmu, tidak pernah di profil.", + "tags.filter": "Tag pribadi", + "select.start": "Pilih", + "select.exit": "Keluar dari pilihan", + "select.all": "Pilih semua", + "select.none": "Batalkan semua pilihan", + "select.toggle": "Pilih “{title}”", + "select.actions": "Tindakan untuk pilihan", + "select.status": "Status", + "select.list": "Daftar", + "select.tag": "Tag", + "select.noLists": "Belum ada daftar — buat di bawah.", + "select.inList": "Sudah ada: {n}/{total}", + "select.addTo": "Tambahkan ke “{list}”", + "select.removeFrom": "Hapus dari “{list}”", + "select.removeTag": "Hapus tag", + "toast.undo": "Urungkan", + "toast.undone": "Diurungkan", + "toast.undoFailed": "Gagal mengurungkan", + "toast.deleted": "“{title}” dihapus", + "toast.status": "“{title}” → {status}", + "toast.removedFromList": "“{title}” dihapus dari “{list}”", + "select.count_zero": "Belum ada judul dipilih", + "select.count_one": "{count} dipilih", + "select.count_other": "{count} dipilih", + "select.statusTitle_one": "Status {count} judul", + "select.statusTitle_other": "Status {count} judul", + "select.listTitle_one": "Daftar · {count} judul", + "select.listTitle_other": "Daftar · {count} judul", + "select.tagTitle_one": "Tag · {count} judul", + "select.tagTitle_other": "Tag · {count} judul", + "select.deleteConfirm_one": "Hapus {count} judul dari koleksimu?", + "select.deleteConfirm_other": "Hapus {count} judul dari koleksimu?", + "toast.deletedMany_one": "{count} judul dihapus", + "toast.deletedMany_other": "{count} judul dihapus", + "toast.statusMany_one": "{count} judul → {status}", + "toast.statusMany_other": "{count} judul → {status}", + "toast.addedToList_one": "{count} judul ditambahkan ke “{list}”", + "toast.addedToList_other": "{count} judul ditambahkan ke “{list}”", + "toast.removedFromListMany_one": "{count} judul dihapus dari “{list}”", + "toast.removedFromListMany_other": "{count} judul dihapus dari “{list}”", + "toast.tagged_one": "#{tag} ditambahkan ke {count} judul", + "toast.tagged_other": "#{tag} ditambahkan ke {count} judul", + "toast.untagged_one": "#{tag} dihapus dari {count} judul", + "toast.untagged_other": "#{tag} dihapus dari {count} judul", } export default dict diff --git a/src/i18n/locales/it.ts b/src/i18n/locales/it.ts index df1ce6b..9221dc3 100644 --- a/src/i18n/locales/it.ts +++ b/src/i18n/locales/it.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} modifica in attesa", 'sync.pending_other': "{count} modifiche in attesa", 'sync.now': "Sincronizza", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Tag personali", + "tags.placeholder": "comfort, halloween, da rivedere con Lea…", + "tags.private": "Visibili solo a te, mai sul tuo profilo.", + "tags.filter": "Tag personali", + "select.start": "Seleziona", + "select.exit": "Esci dalla selezione", + "select.all": "Seleziona tutto", + "select.none": "Deseleziona tutto", + "select.toggle": "Seleziona «{title}»", + "select.actions": "Azioni sulla selezione", + "select.status": "Stato", + "select.list": "Lista", + "select.tag": "Tag", + "select.noLists": "Ancora nessuna lista: creane una qui sotto.", + "select.inList": "Già presenti: {n}/{total}", + "select.addTo": "Aggiungi a «{list}»", + "select.removeFrom": "Rimuovi da «{list}»", + "select.removeTag": "Rimuovi un tag", + "toast.undo": "Annulla", + "toast.undone": "Annullato", + "toast.undoFailed": "Impossibile annullare", + "toast.deleted": "«{title}» eliminato", + "toast.status": "«{title}» → {status}", + "toast.removedFromList": "«{title}» rimosso da «{list}»", + "select.count_zero": "Nessun titolo selezionato", + "select.count_one": "{count} selezionato", + "select.count_other": "{count} selezionati", + "select.statusTitle_one": "Stato di {count} titolo", + "select.statusTitle_other": "Stato di {count} titoli", + "select.listTitle_one": "Liste · {count} titolo", + "select.listTitle_other": "Liste · {count} titoli", + "select.tagTitle_one": "Tag · {count} titolo", + "select.tagTitle_other": "Tag · {count} titoli", + "select.deleteConfirm_one": "Eliminare {count} titolo dalla tua libreria?", + "select.deleteConfirm_other": "Eliminare {count} titoli dalla tua libreria?", + "toast.deletedMany_one": "{count} titolo eliminato", + "toast.deletedMany_other": "{count} titoli eliminati", + "toast.statusMany_one": "{count} titolo → {status}", + "toast.statusMany_other": "{count} titoli → {status}", + "toast.addedToList_one": "{count} titolo aggiunto a «{list}»", + "toast.addedToList_other": "{count} titoli aggiunti a «{list}»", + "toast.removedFromListMany_one": "{count} titolo rimosso da «{list}»", + "toast.removedFromListMany_other": "{count} titoli rimossi da «{list}»", + "toast.tagged_one": "#{tag} aggiunto a {count} titolo", + "toast.tagged_other": "#{tag} aggiunto a {count} titoli", + "toast.untagged_one": "#{tag} rimosso da {count} titolo", + "toast.untagged_other": "#{tag} rimosso da {count} titoli", } export default dict diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts index 67b6839..37c5929 100644 --- a/src/i18n/locales/ja.ts +++ b/src/i18n/locales/ja.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} 件の変更が保留中", 'sync.pending_other': "{count} 件の変更が保留中", 'sync.now': "今すぐ同期", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "マイタグ", + "tags.placeholder": "comfort、ハロウィン、Leaと再視聴…", + "tags.private": "自分だけに表示され、プロフィールには出ません。", + "tags.filter": "マイタグ", + "select.start": "選択", + "select.exit": "選択を終了", + "select.all": "すべて選択", + "select.none": "すべて選択解除", + "select.toggle": "「{title}」を選択", + "select.actions": "選択した作品の操作", + "select.status": "ステータス", + "select.list": "リスト", + "select.tag": "タグ", + "select.noLists": "リストはまだありません。下で作成できます。", + "select.inList": "追加済み:{n}/{total}", + "select.addTo": "「{list}」に追加", + "select.removeFrom": "「{list}」から外す", + "select.removeTag": "タグを外す", + "toast.undo": "元に戻す", + "toast.undone": "元に戻しました", + "toast.undoFailed": "元に戻せませんでした", + "toast.deleted": "「{title}」を削除しました", + "toast.status": "「{title}」→ {status}", + "toast.removedFromList": "「{title}」を「{list}」から外しました", + "select.count_zero": "未選択", + "select.count_one": "{count}件を選択中", + "select.count_other": "{count}件を選択中", + "select.statusTitle_one": "{count}作品のステータス", + "select.statusTitle_other": "{count}作品のステータス", + "select.listTitle_one": "リスト · {count}作品", + "select.listTitle_other": "リスト · {count}作品", + "select.tagTitle_one": "タグ · {count}作品", + "select.tagTitle_other": "タグ · {count}作品", + "select.deleteConfirm_one": "{count}作品をライブラリから削除しますか?", + "select.deleteConfirm_other": "{count}作品をライブラリから削除しますか?", + "toast.deletedMany_one": "{count}作品を削除しました", + "toast.deletedMany_other": "{count}作品を削除しました", + "toast.statusMany_one": "{count}作品 → {status}", + "toast.statusMany_other": "{count}作品 → {status}", + "toast.addedToList_one": "{count}作品を「{list}」に追加しました", + "toast.addedToList_other": "{count}作品を「{list}」に追加しました", + "toast.removedFromListMany_one": "{count}作品を「{list}」から外しました", + "toast.removedFromListMany_other": "{count}作品を「{list}」から外しました", + "toast.tagged_one": "{count}作品に #{tag} を追加しました", + "toast.tagged_other": "{count}作品に #{tag} を追加しました", + "toast.untagged_one": "{count}作品から #{tag} を外しました", + "toast.untagged_other": "{count}作品から #{tag} を外しました", } export default dict diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts index 54d2f0b..8cfb6d8 100644 --- a/src/i18n/locales/ko.ts +++ b/src/i18n/locales/ko.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "변경 {count}개 대기 중", 'sync.pending_other': "변경 {count}개 대기 중", 'sync.now': "지금 동기화", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "개인 태그", + "tags.placeholder": "comfort, 핼러윈, 레아랑 다시 보기…", + "tags.private": "나만 볼 수 있으며 프로필에는 표시되지 않아요.", + "tags.filter": "개인 태그", + "select.start": "선택", + "select.exit": "선택 종료", + "select.all": "모두 선택", + "select.none": "모두 선택 해제", + "select.toggle": "“{title}” 선택", + "select.actions": "선택 항목 작업", + "select.status": "상태", + "select.list": "리스트", + "select.tag": "태그", + "select.noLists": "아직 리스트가 없어요. 아래에서 만들어 보세요.", + "select.inList": "이미 포함: {n}/{total}", + "select.addTo": "“{list}”에 추가", + "select.removeFrom": "“{list}”에서 제거", + "select.removeTag": "태그 제거", + "toast.undo": "실행 취소", + "toast.undone": "실행 취소됨", + "toast.undoFailed": "실행 취소할 수 없어요", + "toast.deleted": "“{title}” 삭제됨", + "toast.status": "“{title}” → {status}", + "toast.removedFromList": "“{title}”을(를) “{list}”에서 제거했어요", + "select.count_zero": "선택한 작품 없음", + "select.count_one": "{count}개 선택됨", + "select.count_other": "{count}개 선택됨", + "select.statusTitle_one": "작품 {count}개의 상태", + "select.statusTitle_other": "작품 {count}개의 상태", + "select.listTitle_one": "리스트 · 작품 {count}개", + "select.listTitle_other": "리스트 · 작품 {count}개", + "select.tagTitle_one": "태그 · 작품 {count}개", + "select.tagTitle_other": "태그 · 작품 {count}개", + "select.deleteConfirm_one": "라이브러리에서 작품 {count}개를 삭제할까요?", + "select.deleteConfirm_other": "라이브러리에서 작품 {count}개를 삭제할까요?", + "toast.deletedMany_one": "작품 {count}개 삭제됨", + "toast.deletedMany_other": "작품 {count}개 삭제됨", + "toast.statusMany_one": "작품 {count}개 → {status}", + "toast.statusMany_other": "작품 {count}개 → {status}", + "toast.addedToList_one": "작품 {count}개를 “{list}”에 추가했어요", + "toast.addedToList_other": "작품 {count}개를 “{list}”에 추가했어요", + "toast.removedFromListMany_one": "작품 {count}개를 “{list}”에서 제거했어요", + "toast.removedFromListMany_other": "작품 {count}개를 “{list}”에서 제거했어요", + "toast.tagged_one": "작품 {count}개에 #{tag} 추가", + "toast.tagged_other": "작품 {count}개에 #{tag} 추가", + "toast.untagged_one": "작품 {count}개에서 #{tag} 제거", + "toast.untagged_other": "작품 {count}개에서 #{tag} 제거", } export default dict diff --git a/src/i18n/locales/nl.ts b/src/i18n/locales/nl.ts index dd2e4f3..5459f41 100644 --- a/src/i18n/locales/nl.ts +++ b/src/i18n/locales/nl.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} wijziging in wachtrij", 'sync.pending_other': "{count} wijzigingen in wachtrij", 'sync.now': "Nu synchroniseren", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Eigen tags", + "tags.placeholder": "comfort, halloween, opnieuw kijken met Lea…", + "tags.private": "Alleen voor jou zichtbaar, nooit op je profiel.", + "tags.filter": "Eigen tags", + "select.start": "Selecteren", + "select.exit": "Selectie sluiten", + "select.all": "Alles selecteren", + "select.none": "Alles deselecteren", + "select.toggle": "‘{title}’ selecteren", + "select.actions": "Acties voor de selectie", + "select.status": "Status", + "select.list": "Lijst", + "select.tag": "Tag", + "select.noLists": "Nog geen lijsten — maak er hieronder een.", + "select.inList": "Er al in: {n}/{total}", + "select.addTo": "Toevoegen aan ‘{list}’", + "select.removeFrom": "Verwijderen uit ‘{list}’", + "select.removeTag": "Tag verwijderen", + "toast.undo": "Ongedaan maken", + "toast.undone": "Ongedaan gemaakt", + "toast.undoFailed": "Ongedaan maken mislukt", + "toast.deleted": "‘{title}’ verwijderd", + "toast.status": "‘{title}’ → {status}", + "toast.removedFromList": "‘{title}’ verwijderd uit ‘{list}’", + "select.count_zero": "Geen titels geselecteerd", + "select.count_one": "{count} geselecteerd", + "select.count_other": "{count} geselecteerd", + "select.statusTitle_one": "Status van {count} titel", + "select.statusTitle_other": "Status van {count} titels", + "select.listTitle_one": "Lijsten · {count} titel", + "select.listTitle_other": "Lijsten · {count} titels", + "select.tagTitle_one": "Tag · {count} titel", + "select.tagTitle_other": "Tag · {count} titels", + "select.deleteConfirm_one": "{count} titel uit je bibliotheek verwijderen?", + "select.deleteConfirm_other": "{count} titels uit je bibliotheek verwijderen?", + "toast.deletedMany_one": "{count} titel verwijderd", + "toast.deletedMany_other": "{count} titels verwijderd", + "toast.statusMany_one": "{count} titel → {status}", + "toast.statusMany_other": "{count} titels → {status}", + "toast.addedToList_one": "{count} titel toegevoegd aan ‘{list}’", + "toast.addedToList_other": "{count} titels toegevoegd aan ‘{list}’", + "toast.removedFromListMany_one": "{count} titel verwijderd uit ‘{list}’", + "toast.removedFromListMany_other": "{count} titels verwijderd uit ‘{list}’", + "toast.tagged_one": "#{tag} toegevoegd aan {count} titel", + "toast.tagged_other": "#{tag} toegevoegd aan {count} titels", + "toast.untagged_one": "#{tag} verwijderd van {count} titel", + "toast.untagged_other": "#{tag} verwijderd van {count} titels", } export default dict diff --git a/src/i18n/locales/pl.ts b/src/i18n/locales/pl.ts index 8427a4b..f45299b 100644 --- a/src/i18n/locales/pl.ts +++ b/src/i18n/locales/pl.ts @@ -989,6 +989,76 @@ const dict: Translations = { 'sync.now': "Synchronizuj", 'sync.pending_few': "{count} zmiany oczekują", 'sync.pending_many': "{count} zmian oczekuje", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Własne tagi", + "tags.placeholder": "comfort, halloween, obejrzeć znów z Leą…", + "tags.private": "Widoczne tylko dla ciebie, nigdy na profilu.", + "tags.filter": "Własne tagi", + "select.start": "Zaznacz", + "select.exit": "Zakończ zaznaczanie", + "select.all": "Zaznacz wszystko", + "select.none": "Odznacz wszystko", + "select.toggle": "Zaznacz „{title}”", + "select.actions": "Działania na zaznaczonych", + "select.status": "Status", + "select.list": "Lista", + "select.tag": "Tag", + "select.noLists": "Brak list — utwórz ją poniżej.", + "select.inList": "Już na liście: {n}/{total}", + "select.addTo": "Dodaj do „{list}”", + "select.removeFrom": "Usuń z „{list}”", + "select.removeTag": "Usuń tag", + "toast.undo": "Cofnij", + "toast.undone": "Cofnięto", + "toast.undoFailed": "Nie udało się cofnąć", + "toast.deleted": "Usunięto „{title}”", + "toast.status": "„{title}” → {status}", + "toast.removedFromList": "Usunięto „{title}” z „{list}”", + "select.count_zero": "Nic nie zaznaczono", + "select.count_one": "Zaznaczono: {count}", + "select.count_few": "Zaznaczono: {count}", + "select.count_many": "Zaznaczono: {count}", + "select.count_other": "Zaznaczono: {count}", + "select.statusTitle_one": "Status: {count} tytuł", + "select.statusTitle_few": "Status: {count} tytuły", + "select.statusTitle_many": "Status: {count} tytułów", + "select.statusTitle_other": "Status: {count} tytułu", + "select.listTitle_one": "Listy · {count} tytuł", + "select.listTitle_few": "Listy · {count} tytuły", + "select.listTitle_many": "Listy · {count} tytułów", + "select.listTitle_other": "Listy · {count} tytułu", + "select.tagTitle_one": "Tag · {count} tytuł", + "select.tagTitle_few": "Tag · {count} tytuły", + "select.tagTitle_many": "Tag · {count} tytułów", + "select.tagTitle_other": "Tag · {count} tytułu", + "select.deleteConfirm_one": "Usunąć z biblioteki: {count} tytuł?", + "select.deleteConfirm_few": "Usunąć z biblioteki: {count} tytuły?", + "select.deleteConfirm_many": "Usunąć z biblioteki: {count} tytułów?", + "select.deleteConfirm_other": "Usunąć z biblioteki: {count} tytułu?", + "toast.deletedMany_one": "Usunięto: {count} tytuł", + "toast.deletedMany_few": "Usunięto: {count} tytuły", + "toast.deletedMany_many": "Usunięto: {count} tytułów", + "toast.deletedMany_other": "Usunięto: {count} tytułu", + "toast.statusMany_one": "{count} tytuł → {status}", + "toast.statusMany_few": "{count} tytuły → {status}", + "toast.statusMany_many": "{count} tytułów → {status}", + "toast.statusMany_other": "{count} tytułu → {status}", + "toast.addedToList_one": "Dodano do „{list}”: {count} tytuł", + "toast.addedToList_few": "Dodano do „{list}”: {count} tytuły", + "toast.addedToList_many": "Dodano do „{list}”: {count} tytułów", + "toast.addedToList_other": "Dodano do „{list}”: {count} tytułu", + "toast.removedFromListMany_one": "Usunięto z „{list}”: {count} tytuł", + "toast.removedFromListMany_few": "Usunięto z „{list}”: {count} tytuły", + "toast.removedFromListMany_many": "Usunięto z „{list}”: {count} tytułów", + "toast.removedFromListMany_other": "Usunięto z „{list}”: {count} tytułu", + "toast.tagged_one": "Dodano #{tag}: {count} tytuł", + "toast.tagged_few": "Dodano #{tag}: {count} tytuły", + "toast.tagged_many": "Dodano #{tag}: {count} tytułów", + "toast.tagged_other": "Dodano #{tag}: {count} tytułu", + "toast.untagged_one": "Usunięto #{tag}: {count} tytuł", + "toast.untagged_few": "Usunięto #{tag}: {count} tytuły", + "toast.untagged_many": "Usunięto #{tag}: {count} tytułów", + "toast.untagged_other": "Usunięto #{tag}: {count} tytułu", } export default dict diff --git a/src/i18n/locales/pt.ts b/src/i18n/locales/pt.ts index dee6d12..7c94631 100644 --- a/src/i18n/locales/pt.ts +++ b/src/i18n/locales/pt.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} alteração pendente", 'sync.pending_other': "{count} alterações pendentes", 'sync.now': "Sincronizar", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Tags pessoais", + "tags.placeholder": "comfort, halloween, rever com a Lea…", + "tags.private": "Só você as vê, nunca no seu perfil.", + "tags.filter": "Tags pessoais", + "select.start": "Selecionar", + "select.exit": "Sair da seleção", + "select.all": "Selecionar tudo", + "select.none": "Desmarcar tudo", + "select.toggle": "Selecionar “{title}”", + "select.actions": "Ações da seleção", + "select.status": "Status", + "select.list": "Lista", + "select.tag": "Tag", + "select.noLists": "Nenhuma lista ainda — crie uma abaixo.", + "select.inList": "Já incluídos: {n}/{total}", + "select.addTo": "Adicionar a “{list}”", + "select.removeFrom": "Remover de “{list}”", + "select.removeTag": "Remover uma tag", + "toast.undo": "Desfazer", + "toast.undone": "Desfeito", + "toast.undoFailed": "Não foi possível desfazer", + "toast.deleted": "“{title}” excluído", + "toast.status": "“{title}” → {status}", + "toast.removedFromList": "“{title}” removido de “{list}”", + "select.count_zero": "Nenhum título selecionado", + "select.count_one": "{count} selecionado", + "select.count_other": "{count} selecionados", + "select.statusTitle_one": "Status de {count} título", + "select.statusTitle_other": "Status de {count} títulos", + "select.listTitle_one": "Listas · {count} título", + "select.listTitle_other": "Listas · {count} títulos", + "select.tagTitle_one": "Tag · {count} título", + "select.tagTitle_other": "Tag · {count} títulos", + "select.deleteConfirm_one": "Excluir {count} título da sua biblioteca?", + "select.deleteConfirm_other": "Excluir {count} títulos da sua biblioteca?", + "toast.deletedMany_one": "{count} título excluído", + "toast.deletedMany_other": "{count} títulos excluídos", + "toast.statusMany_one": "{count} título → {status}", + "toast.statusMany_other": "{count} títulos → {status}", + "toast.addedToList_one": "{count} título adicionado a “{list}”", + "toast.addedToList_other": "{count} títulos adicionados a “{list}”", + "toast.removedFromListMany_one": "{count} título removido de “{list}”", + "toast.removedFromListMany_other": "{count} títulos removidos de “{list}”", + "toast.tagged_one": "#{tag} adicionada a {count} título", + "toast.tagged_other": "#{tag} adicionada a {count} títulos", + "toast.untagged_one": "#{tag} removida de {count} título", + "toast.untagged_other": "#{tag} removida de {count} títulos", } export default dict diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index c95076d..4d6f2ea 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -989,6 +989,76 @@ const dict: Translations = { 'sync.now': "Синхронизировать", 'sync.pending_few': "{count} изменения ожидают", 'sync.pending_many': "{count} изменений ожидают", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Личные теги", + "tags.placeholder": "comfort, хэллоуин, пересмотреть с Леей…", + "tags.private": "Видны только вам, никогда в профиле.", + "tags.filter": "Личные теги", + "select.start": "Выбрать", + "select.exit": "Выйти из выбора", + "select.all": "Выбрать все", + "select.none": "Снять выбор", + "select.toggle": "Выбрать «{title}»", + "select.actions": "Действия с выбранным", + "select.status": "Статус", + "select.list": "Список", + "select.tag": "Тег", + "select.noLists": "Списков пока нет — создайте ниже.", + "select.inList": "Уже в списке: {n}/{total}", + "select.addTo": "Добавить в «{list}»", + "select.removeFrom": "Убрать из «{list}»", + "select.removeTag": "Убрать тег", + "toast.undo": "Отменить", + "toast.undone": "Отменено", + "toast.undoFailed": "Не удалось отменить", + "toast.deleted": "«{title}» удалён", + "toast.status": "«{title}» → {status}", + "toast.removedFromList": "«{title}» убран из «{list}»", + "select.count_zero": "Ничего не выбрано", + "select.count_one": "Выбран {count}", + "select.count_few": "Выбрано {count}", + "select.count_many": "Выбрано {count}", + "select.count_other": "Выбрано {count}", + "select.statusTitle_one": "Статус: {count} тайтл", + "select.statusTitle_few": "Статус: {count} тайтла", + "select.statusTitle_many": "Статус: {count} тайтлов", + "select.statusTitle_other": "Статус: {count} тайтла", + "select.listTitle_one": "Списки · {count} тайтл", + "select.listTitle_few": "Списки · {count} тайтла", + "select.listTitle_many": "Списки · {count} тайтлов", + "select.listTitle_other": "Списки · {count} тайтла", + "select.tagTitle_one": "Тег · {count} тайтл", + "select.tagTitle_few": "Тег · {count} тайтла", + "select.tagTitle_many": "Тег · {count} тайтлов", + "select.tagTitle_other": "Тег · {count} тайтла", + "select.deleteConfirm_one": "Удалить из библиотеки {count} тайтл?", + "select.deleteConfirm_few": "Удалить из библиотеки {count} тайтла?", + "select.deleteConfirm_many": "Удалить из библиотеки {count} тайтлов?", + "select.deleteConfirm_other": "Удалить из библиотеки {count} тайтла?", + "toast.deletedMany_one": "Удалено: {count} тайтл", + "toast.deletedMany_few": "Удалено: {count} тайтла", + "toast.deletedMany_many": "Удалено: {count} тайтлов", + "toast.deletedMany_other": "Удалено: {count} тайтла", + "toast.statusMany_one": "{count} тайтл → {status}", + "toast.statusMany_few": "{count} тайтла → {status}", + "toast.statusMany_many": "{count} тайтлов → {status}", + "toast.statusMany_other": "{count} тайтла → {status}", + "toast.addedToList_one": "Добавлено в «{list}»: {count} тайтл", + "toast.addedToList_few": "Добавлено в «{list}»: {count} тайтла", + "toast.addedToList_many": "Добавлено в «{list}»: {count} тайтлов", + "toast.addedToList_other": "Добавлено в «{list}»: {count} тайтла", + "toast.removedFromListMany_one": "Убрано из «{list}»: {count} тайтл", + "toast.removedFromListMany_few": "Убрано из «{list}»: {count} тайтла", + "toast.removedFromListMany_many": "Убрано из «{list}»: {count} тайтлов", + "toast.removedFromListMany_other": "Убрано из «{list}»: {count} тайтла", + "toast.tagged_one": "#{tag} добавлен: {count} тайтл", + "toast.tagged_few": "#{tag} добавлен: {count} тайтла", + "toast.tagged_many": "#{tag} добавлен: {count} тайтлов", + "toast.tagged_other": "#{tag} добавлен: {count} тайтла", + "toast.untagged_one": "#{tag} убран: {count} тайтл", + "toast.untagged_few": "#{tag} убран: {count} тайтла", + "toast.untagged_many": "#{tag} убран: {count} тайтлов", + "toast.untagged_other": "#{tag} убран: {count} тайтла", } export default dict diff --git a/src/i18n/locales/th.ts b/src/i18n/locales/th.ts index 4551741..b9caa06 100644 --- a/src/i18n/locales/th.ts +++ b/src/i18n/locales/th.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "รอซิงค์ {count} รายการ", 'sync.pending_other': "รอซิงค์ {count} รายการ", 'sync.now': "ซิงค์ตอนนี้", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "แท็กส่วนตัว", + "tags.placeholder": "comfort, ฮาโลวีน, ดูซ้ำกับลีอา…", + "tags.private": "เห็นได้เฉพาะคุณ ไม่แสดงในโปรไฟล์", + "tags.filter": "แท็กส่วนตัว", + "select.start": "เลือก", + "select.exit": "ออกจากการเลือก", + "select.all": "เลือกทั้งหมด", + "select.none": "ยกเลิกการเลือกทั้งหมด", + "select.toggle": "เลือก “{title}”", + "select.actions": "การทำงานกับรายการที่เลือก", + "select.status": "สถานะ", + "select.list": "ลิสต์", + "select.tag": "แท็ก", + "select.noLists": "ยังไม่มีลิสต์ — สร้างได้ด้านล่าง", + "select.inList": "อยู่แล้ว: {n}/{total}", + "select.addTo": "เพิ่มไปยัง “{list}”", + "select.removeFrom": "นำออกจาก “{list}”", + "select.removeTag": "ลบแท็ก", + "toast.undo": "เลิกทำ", + "toast.undone": "เลิกทำแล้ว", + "toast.undoFailed": "เลิกทำไม่สำเร็จ", + "toast.deleted": "ลบ “{title}” แล้ว", + "toast.status": "“{title}” → {status}", + "toast.removedFromList": "นำ “{title}” ออกจาก “{list}” แล้ว", + "select.count_zero": "ยังไม่ได้เลือก", + "select.count_one": "เลือกแล้ว {count} เรื่อง", + "select.count_other": "เลือกแล้ว {count} เรื่อง", + "select.statusTitle_one": "สถานะของ {count} เรื่อง", + "select.statusTitle_other": "สถานะของ {count} เรื่อง", + "select.listTitle_one": "ลิสต์ · {count} เรื่อง", + "select.listTitle_other": "ลิสต์ · {count} เรื่อง", + "select.tagTitle_one": "แท็ก · {count} เรื่อง", + "select.tagTitle_other": "แท็ก · {count} เรื่อง", + "select.deleteConfirm_one": "ลบ {count} เรื่องออกจากคลังของคุณ?", + "select.deleteConfirm_other": "ลบ {count} เรื่องออกจากคลังของคุณ?", + "toast.deletedMany_one": "ลบ {count} เรื่องแล้ว", + "toast.deletedMany_other": "ลบ {count} เรื่องแล้ว", + "toast.statusMany_one": "{count} เรื่อง → {status}", + "toast.statusMany_other": "{count} เรื่อง → {status}", + "toast.addedToList_one": "เพิ่ม {count} เรื่องไปยัง “{list}” แล้ว", + "toast.addedToList_other": "เพิ่ม {count} เรื่องไปยัง “{list}” แล้ว", + "toast.removedFromListMany_one": "นำ {count} เรื่องออกจาก “{list}” แล้ว", + "toast.removedFromListMany_other": "นำ {count} เรื่องออกจาก “{list}” แล้ว", + "toast.tagged_one": "เพิ่ม #{tag} ให้ {count} เรื่องแล้ว", + "toast.tagged_other": "เพิ่ม #{tag} ให้ {count} เรื่องแล้ว", + "toast.untagged_one": "ลบ #{tag} จาก {count} เรื่องแล้ว", + "toast.untagged_other": "ลบ #{tag} จาก {count} เรื่องแล้ว", } export default dict diff --git a/src/i18n/locales/tr.ts b/src/i18n/locales/tr.ts index ea49087..e1a5465 100644 --- a/src/i18n/locales/tr.ts +++ b/src/i18n/locales/tr.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} değişiklik bekliyor", 'sync.pending_other': "{count} değişiklik bekliyor", 'sync.now': "Şimdi eşitle", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Kişisel etiketler", + "tags.placeholder": "comfort, cadılar bayramı, Lea ile tekrar izle…", + "tags.private": "Yalnızca sen görürsün, profilinde asla görünmez.", + "tags.filter": "Kişisel etiketler", + "select.start": "Seç", + "select.exit": "Seçimden çık", + "select.all": "Tümünü seç", + "select.none": "Seçimi kaldır", + "select.toggle": "“{title}” seç", + "select.actions": "Seçim işlemleri", + "select.status": "Durum", + "select.list": "Liste", + "select.tag": "Etiket", + "select.noLists": "Henüz liste yok — aşağıdan oluştur.", + "select.inList": "Zaten içinde: {n}/{total}", + "select.addTo": "“{list}” listesine ekle", + "select.removeFrom": "“{list}” listesinden çıkar", + "select.removeTag": "Etiketi kaldır", + "toast.undo": "Geri al", + "toast.undone": "Geri alındı", + "toast.undoFailed": "Geri alınamadı", + "toast.deleted": "“{title}” silindi", + "toast.status": "“{title}” → {status}", + "toast.removedFromList": "“{title}”, “{list}” listesinden çıkarıldı", + "select.count_zero": "Hiçbir yapım seçilmedi", + "select.count_one": "{count} seçildi", + "select.count_other": "{count} seçildi", + "select.statusTitle_one": "{count} yapımın durumu", + "select.statusTitle_other": "{count} yapımın durumu", + "select.listTitle_one": "Listeler · {count} yapım", + "select.listTitle_other": "Listeler · {count} yapım", + "select.tagTitle_one": "Etiket · {count} yapım", + "select.tagTitle_other": "Etiket · {count} yapım", + "select.deleteConfirm_one": "{count} yapım kitaplığından silinsin mi?", + "select.deleteConfirm_other": "{count} yapım kitaplığından silinsin mi?", + "toast.deletedMany_one": "{count} yapım silindi", + "toast.deletedMany_other": "{count} yapım silindi", + "toast.statusMany_one": "{count} yapım → {status}", + "toast.statusMany_other": "{count} yapım → {status}", + "toast.addedToList_one": "{count} yapım “{list}” listesine eklendi", + "toast.addedToList_other": "{count} yapım “{list}” listesine eklendi", + "toast.removedFromListMany_one": "{count} yapım “{list}” listesinden çıkarıldı", + "toast.removedFromListMany_other": "{count} yapım “{list}” listesinden çıkarıldı", + "toast.tagged_one": "#{tag}, {count} yapıma eklendi", + "toast.tagged_other": "#{tag}, {count} yapıma eklendi", + "toast.untagged_one": "#{tag}, {count} yapımdan kaldırıldı", + "toast.untagged_other": "#{tag}, {count} yapımdan kaldırıldı", } export default dict diff --git a/src/i18n/locales/vi.ts b/src/i18n/locales/vi.ts index 632c8a9..c83c8e3 100644 --- a/src/i18n/locales/vi.ts +++ b/src/i18n/locales/vi.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} thay đổi đang chờ", 'sync.pending_other': "{count} thay đổi đang chờ", 'sync.now': "Đồng bộ ngay", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "Thẻ cá nhân", + "tags.placeholder": "comfort, halloween, xem lại với Lea…", + "tags.private": "Chỉ mình bạn thấy, không bao giờ hiện trên hồ sơ.", + "tags.filter": "Thẻ cá nhân", + "select.start": "Chọn", + "select.exit": "Thoát chế độ chọn", + "select.all": "Chọn tất cả", + "select.none": "Bỏ chọn tất cả", + "select.toggle": "Chọn “{title}”", + "select.actions": "Thao tác với mục đã chọn", + "select.status": "Trạng thái", + "select.list": "Danh sách", + "select.tag": "Thẻ", + "select.noLists": "Chưa có danh sách — tạo ở bên dưới.", + "select.inList": "Đã có: {n}/{total}", + "select.addTo": "Thêm vào “{list}”", + "select.removeFrom": "Gỡ khỏi “{list}”", + "select.removeTag": "Gỡ thẻ", + "toast.undo": "Hoàn tác", + "toast.undone": "Đã hoàn tác", + "toast.undoFailed": "Không thể hoàn tác", + "toast.deleted": "Đã xóa “{title}”", + "toast.status": "“{title}” → {status}", + "toast.removedFromList": "Đã gỡ “{title}” khỏi “{list}”", + "select.count_zero": "Chưa chọn phim nào", + "select.count_one": "Đã chọn {count}", + "select.count_other": "Đã chọn {count}", + "select.statusTitle_one": "Trạng thái của {count} phim", + "select.statusTitle_other": "Trạng thái của {count} phim", + "select.listTitle_one": "Danh sách · {count} phim", + "select.listTitle_other": "Danh sách · {count} phim", + "select.tagTitle_one": "Thẻ · {count} phim", + "select.tagTitle_other": "Thẻ · {count} phim", + "select.deleteConfirm_one": "Xóa {count} phim khỏi thư viện?", + "select.deleteConfirm_other": "Xóa {count} phim khỏi thư viện?", + "toast.deletedMany_one": "Đã xóa {count} phim", + "toast.deletedMany_other": "Đã xóa {count} phim", + "toast.statusMany_one": "{count} phim → {status}", + "toast.statusMany_other": "{count} phim → {status}", + "toast.addedToList_one": "Đã thêm {count} phim vào “{list}”", + "toast.addedToList_other": "Đã thêm {count} phim vào “{list}”", + "toast.removedFromListMany_one": "Đã gỡ {count} phim khỏi “{list}”", + "toast.removedFromListMany_other": "Đã gỡ {count} phim khỏi “{list}”", + "toast.tagged_one": "Đã thêm #{tag} cho {count} phim", + "toast.tagged_other": "Đã thêm #{tag} cho {count} phim", + "toast.untagged_one": "Đã gỡ #{tag} khỏi {count} phim", + "toast.untagged_other": "Đã gỡ #{tag} khỏi {count} phim", } export default dict diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index ad9a6c6..66ea193 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -897,6 +897,54 @@ const dict: Translations = { 'sync.pending_one': "{count} 项更改待上传", 'sync.pending_other': "{count} 项更改待上传", 'sync.now': "立即同步", + // — Bibliothèque : tags perso, actions groupées, « Annuler » — + "tags.label": "个人标签", + "tags.placeholder": "comfort、万圣节、和 Lea 重温…", + "tags.private": "仅自己可见,不会显示在个人主页上。", + "tags.filter": "个人标签", + "select.start": "选择", + "select.exit": "退出选择", + "select.all": "全选", + "select.none": "取消全选", + "select.toggle": "选择《{title}》", + "select.actions": "所选作品操作", + "select.status": "状态", + "select.list": "片单", + "select.tag": "标签", + "select.noLists": "还没有片单——在下方创建一个。", + "select.inList": "已在其中:{n}/{total}", + "select.addTo": "添加到“{list}”", + "select.removeFrom": "从“{list}”移除", + "select.removeTag": "移除标签", + "toast.undo": "撤销", + "toast.undone": "已撤销", + "toast.undoFailed": "无法撤销", + "toast.deleted": "已删除《{title}》", + "toast.status": "《{title}》→ {status}", + "toast.removedFromList": "已将《{title}》从“{list}”移除", + "select.count_zero": "未选择任何作品", + "select.count_one": "已选择 {count} 部", + "select.count_other": "已选择 {count} 部", + "select.statusTitle_one": "{count} 部作品的状态", + "select.statusTitle_other": "{count} 部作品的状态", + "select.listTitle_one": "片单 · {count} 部", + "select.listTitle_other": "片单 · {count} 部", + "select.tagTitle_one": "标签 · {count} 部", + "select.tagTitle_other": "标签 · {count} 部", + "select.deleteConfirm_one": "要从片库中删除 {count} 部作品吗?", + "select.deleteConfirm_other": "要从片库中删除 {count} 部作品吗?", + "toast.deletedMany_one": "已删除 {count} 部作品", + "toast.deletedMany_other": "已删除 {count} 部作品", + "toast.statusMany_one": "{count} 部作品 → {status}", + "toast.statusMany_other": "{count} 部作品 → {status}", + "toast.addedToList_one": "已将 {count} 部作品添加到“{list}”", + "toast.addedToList_other": "已将 {count} 部作品添加到“{list}”", + "toast.removedFromListMany_one": "已将 {count} 部作品从“{list}”移除", + "toast.removedFromListMany_other": "已将 {count} 部作品从“{list}”移除", + "toast.tagged_one": "已为 {count} 部作品添加 #{tag}", + "toast.tagged_other": "已为 {count} 部作品添加 #{tag}", + "toast.untagged_one": "已从 {count} 部作品移除 #{tag}", + "toast.untagged_other": "已从 {count} 部作品移除 #{tag}", } export default dict diff --git a/src/lib/backup.ts b/src/lib/backup.ts index a98f477..fad9d29 100644 --- a/src/lib/backup.ts +++ b/src/lib/backup.ts @@ -18,7 +18,7 @@ import { safeSeasons, safeStringList, } from './security' -import { todayISO, uid } from './utils' +import { normalizeText, todayISO, uid } from './utils' const TYPES = new Set(MEDIA_TYPES.map((t) => t.value)) const STATUS_SET = new Set(STATUSES.map((s) => s.value)) @@ -62,6 +62,21 @@ function safeDates(v: unknown): string[] | undefined { return out.length ? out : undefined } +/** Tags perso : texte court, sans doublon (casse et accents ignorés), 30 max. */ +export function safeTags(v: unknown): string[] | undefined { + const seen = new Set() + const out: string[] = [] + for (const tag of safeStringList(v, LIMITS.tags * 2, LIMITS.tagLength)) { + const s = tag.replace(/\s+/g, ' ').replace(/^#+/, '').trim() + const key = normalizeText(s) + if (!s || seen.has(key)) continue + seen.add(key) + out.push(s) + if (out.length >= LIMITS.tags) break + } + return out.length ? out : undefined +} + /** Valide et nettoie une fiche (import, synchro, écriture locale). Renvoie null si inutilisable. */ export function normalizeItem(raw: unknown): MediaItem | null { if (!isPlainObject(raw)) return null @@ -83,6 +98,7 @@ export function normalizeItem(raw: unknown): MediaItem | null { const cap = episodeCap({ episodesTotal, seasons }) if (cap && episodesWatched > cap) episodesWatched = cap const listIds = safeStringList(r.listIds, LIMITS.lists, 64).filter(isSafeId) + const tags = safeTags(r.tags) return { id: isSafeId(r.id) ? r.id : uid(), title, @@ -111,6 +127,7 @@ export function normalizeItem(raw: unknown): MediaItem | null { externalId: isSafeExternalId(r.externalId) ? r.externalId : undefined, top: normalizeTop(r.top), listIds: listIds.length ? listIds : undefined, + tags, countries: safeCountries(r.countries), rewatchDates: safeDates(r.rewatchDates), publicRating: (() => { diff --git a/src/lib/bulk.ts b/src/lib/bulk.ts new file mode 100644 index 0000000..a7432d2 --- /dev/null +++ b/src/lib/bulk.ts @@ -0,0 +1,43 @@ +import type { MediaInput, MediaItem, WatchStatus } from '../types' +import { TYPE_BY_VALUE } from './constants' +import { episodeCap } from './franchise' +import { LIMITS } from './security' +import { normalizeText, todayISO } from './utils' + +/** + * Nouveau statut → ce qui change sur la fiche (mêmes règles que les boutons de la fiche) : + * « À voir » efface les dates, « Vu » date la fin (et coche tous les épisodes connus)… + */ +export function statusPatch(item: MediaItem, s: WatchStatus): Partial { + const patch: Partial = { status: s } + const episodic = TYPE_BY_VALUE[item.type].episodic + const today = todayISO() + if (s === 'a_voir') Object.assign(patch, { startDate: undefined, endDate: undefined }) + if (s === 'en_cours') Object.assign(patch, { startDate: episodic && !item.episodesWatched ? item.startDate : (item.startDate ?? today), endDate: undefined }) + if (s === 'termine') { + patch.endDate = item.status === 'termine' && item.endDate ? item.endDate : today + if (!item.startDate) patch.startDate = episodic && item.episodesWatched ? today : patch.endDate + const cap = episodeCap(item) + if (episodic && cap) patch.episodesWatched = cap + } + return patch +} + +/** Tag saisi → tag enregistré : sans « # », espaces simplifiés, et même écriture qu'un tag existant. */ +export function cleanTag(input: string, existing: string[] = []): string { + const s = input.replace(/\s+/g, ' ').replace(/^#+/, '').trim().slice(0, LIMITS.tagLength) + const key = normalizeText(s) + return existing.find((e) => normalizeText(e) === key) ?? s +} + +/** Tous les tags utilisés dans la bibliothèque, du plus fréquent au moins fréquent. */ +export function allTags(items: MediaItem[]): string[] { + const count = new Map() + for (const i of items) for (const tag of i.tags ?? []) count.set(tag, (count.get(tag) ?? 0) + 1) + return [...count.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).map(([tag]) => tag) +} + +export const hasTag = (item: MediaItem, tag: string) => { + const key = normalizeText(tag) + return !!item.tags?.some((x) => normalizeText(x) === key) +} diff --git a/src/lib/cloud/social.ts b/src/lib/cloud/social.ts index c103754..85792eb 100644 --- a/src/lib/cloud/social.ts +++ b/src/lib/cloud/social.ts @@ -86,8 +86,18 @@ function toCard(raw: unknown): ProfileCard | null { } } +/** Fiche de quelqu'un d'autre : ses tags et listes perso restent privés (même si un ancien serveur les renvoyait). */ +function othersItem(v: unknown): MediaItem | null { + const item = normalizeItem(v) + if (item) { + delete item.tags + delete item.listIds + } + return item +} + const toItems = (v: unknown): MediaItem[] => - Array.isArray(v) ? v.slice(0, 200).map(normalizeItem).filter((i): i is MediaItem => i !== null) : [] + Array.isArray(v) ? v.slice(0, 200).map(othersItem).filter((i): i is MediaItem => i !== null) : [] function toProfile(raw: unknown): Profile | null { const card = toCard(raw) @@ -163,7 +173,7 @@ export async function getFeed(before?: string): Promise { const out: FeedEntry[] = [] for (const r of raw.slice(0, 50)) { if (!isPlainObject(r) || !isPlainObject(r.user)) continue - const item = normalizeItem(r.item) + const item = othersItem(r.item) const name = username(r.user.username) const createdAt = safeIso(r.created_at) const kind = r.kind diff --git a/src/lib/legacyImport.ts b/src/lib/legacyImport.ts index 4d3b6e1..35b1d28 100644 --- a/src/lib/legacyImport.ts +++ b/src/lib/legacyImport.ts @@ -167,7 +167,8 @@ export function convertLegacyBackup(data: LegacyFile): { items: MediaItem[]; ski const genres = splitGenres(rawGenres, isFilm) if (isFilm && type === 'film' && countries.includes('JP') && rawGenres.includes('Animation')) genres.unshift('Anime') - for (const t of itemTags.get(r.id) ?? []) if (!genres.includes(t) && genres.length < LIMITS.genres) genres.push(t) + // Tags perso de l'ancienne appli → tags personnels (privés), plus mélangés aux genres + const tags = [...new Set((itemTags.get(r.id) ?? []).map((t) => t.slice(0, LIMITS.tagLength)))].slice(0, LIMITS.tags) const note = typeof r.note === 'number' && Number.isFinite(r.note) && r.note > 0 ? Math.min(10, Math.round(r.note * 2 * 2) / 2) : undefined const created = toISO(r.date_added) ?? now @@ -192,6 +193,7 @@ export function convertLegacyBackup(data: LegacyFile): { items: MediaItem[]; ski startDate, endDate, genres, + tags: tags.length ? tags : undefined, notes: cleanText( [cleanText(r.comment, LIMITS.notes), cleanText(r.director, LIMITS.shortText) ? `Réalisation : ${cleanText(r.director, LIMITS.shortText)}` : ''] .filter(Boolean) diff --git a/src/lib/security.ts b/src/lib/security.ts index df88228..f849cf8 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -26,6 +26,8 @@ export const LIMITS = { notes: 20000, overview: 10000, genres: 40, + tags: 30, + tagLength: 40, posterDataUrl: 3 * 1024 * 1024, // ~3 Mo par affiche en data URL searchQuery: 200, } diff --git a/src/pages/CatalogPage.tsx b/src/pages/CatalogPage.tsx index a0be75c..17be1b1 100644 --- a/src/pages/CatalogPage.tsx +++ b/src/pages/CatalogPage.tsx @@ -1,7 +1,7 @@ import { genreLabel, subtypeLabel } from '../lib/genres' import { locale, t } from '../i18n' -import { Heart, Search, SlidersHorizontal, X } from 'lucide-react' -import { useMemo, useState } from 'react' +import { CheckSquare, Hash, Heart, Search, SlidersHorizontal, X } from 'lucide-react' +import { useEffect, useMemo, useState } from 'react' import { StatusDot } from '../components/Badges' import JournalView from '../components/JournalView' import ListsView from '../components/ListsView' @@ -10,6 +10,11 @@ import { EmptyState, PageHeader } from '../components/ui' import { MEDIA_TYPES, STATUSES } from '../lib/constants' import { cx, normalizeText } from '../lib/utils' import { useMedia } from '../store' +import SelectableCard from '../components/library/SelectableCard' +import SelectionBar from '../components/library/SelectionBar' +import { allTags, hasTag } from '../lib/bulk' +import { useBackToClose } from '../lib/backNav' +import { useEscape } from '../lib/escape' import type { MediaItem, MediaType, WatchStatus } from '../types' type SortKey = 'recent' | 'rating' | 'title' | 'watched' @@ -37,6 +42,27 @@ export default function CatalogPage({ onOpen, onAdd }: Props) { const [favOnly, setFavOnly] = useState(false) const [sort, setSort] = useState('recent') const [showFilters, setShowFilters] = useState(false) + const [tag, setTag] = useState('') + // Sélection multiple (actions groupées) : null = mode normal + const [selection, setSelection] = useState | null>(null) + const selecting = selection !== null + const exitSelection = () => setSelection(null) + useEscape(exitSelection, selecting) + useBackToClose(exitSelection, selecting) + const toggleSelected = (id: string) => + setSelection((prev) => { + const next = new Set(prev ?? []) + if (next.has(id)) next.delete(id) + else next.add(id) + return next + }) + const startSelection = (id: string) => setSelection((prev) => new Set([...(prev ?? []), id])) + // On quitte la sélection en changeant d'onglet (journal, listes) + useEffect(() => { + if (view !== 'titles') setSelection(null) + }, [view]) + + const tags = useMemo(() => allTags(items), [items]) const allGenres = useMemo( () => [...new Set(items.flatMap((i) => i.genres))].sort((a, b) => a.localeCompare(b, locale())), @@ -59,8 +85,9 @@ export default function CatalogPage({ onOpen, onAdd }: Props) { if (genre && !i.genres.includes(genre)) return false if (minRating && (i.rating ?? 0) < minRating) return false if (favOnly && !i.favorite) return false + if (tag && !hasTag(i, tag)) return false if (q) { - const haystack = normalizeText([i.title, i.originalTitle, i.subtype, i.subtype && subtypeLabel(i.subtype), i.platform, ...i.genres, ...i.genres.map(genreLabel)].filter(Boolean).join(' ')) + const haystack = normalizeText([i.title, i.originalTitle, i.subtype, i.subtype && subtypeLabel(i.subtype), i.platform, ...i.genres, ...i.genres.map(genreLabel), ...(i.tags ?? [])].filter(Boolean).join(' ')) if (!haystack.includes(q)) return false } return true @@ -71,9 +98,9 @@ export default function CatalogPage({ onOpen, onAdd }: Props) { else if (sort === 'watched') sorted.sort((a, b) => (b.endDate ?? b.startDate ?? '').localeCompare(a.endDate ?? a.startDate ?? '')) return sorted - }, [items, query, types, status, genre, minRating, favOnly, sort]) + }, [items, query, types, status, genre, minRating, favOnly, tag, sort]) - const activeAdvanced = (genre ? 1 : 0) + (minRating ? 1 : 0) + (favOnly ? 1 : 0) + const activeAdvanced = (genre ? 1 : 0) + (minRating ? 1 : 0) + (favOnly ? 1 : 0) + (tag ? 1 : 0) const anyFilter = query || types.size || status || activeAdvanced const resetAll = () => { setQuery('') @@ -82,8 +109,13 @@ export default function CatalogPage({ onOpen, onAdd }: Props) { setGenre('') setMinRating(0) setFavOnly(false) + setTag('') } + // Fiches sélectionnées encore présentes (une fiche a pu être supprimée entre-temps) + const selected = useMemo(() => (selection ? items.filter((i) => selection.has(i.id)) : []), [items, selection]) + const allShownSelected = selecting && results.length > 0 && results.every((i) => selection.has(i.id)) + // Options de note minimale selon l'échelle affichée (valeurs internes sur 10) const ratingOptions = settings.ratingScale === '5' ? [2, 4, 6, 8, 9, 10] : [5, 6, 7, 8, 9, 10] @@ -123,6 +155,23 @@ export default function CatalogPage({ onOpen, onAdd }: Props) { {/* Recherche + filtres (collants en haut) */}
    + {selecting && ( +
    + +

    + {t('select.count', { count: selected.length })} +

    + +
    + )}
    @@ -146,6 +195,17 @@ export default function CatalogPage({ onOpen, onAdd }: Props) { {activeAdvanced} )} + {results.length > 0 && ( + + )}
    @@ -202,6 +262,19 @@ export default function CatalogPage({ onOpen, onAdd }: Props) { ))} + {tags.length > 0 && ( +
    + {t('tags.filter')} +
    + {tags.map((tg) => ( + + ))} +
    +
    + )} @@ -227,10 +300,20 @@ export default function CatalogPage({ onOpen, onAdd }: Props) { ) : (
    {results.map((item) => ( - + toggleSelected(item.id)} + onStartSelect={() => startSelection(item.id)} + > + + ))}
    )} + {selecting && } )} diff --git a/src/store.tsx b/src/store.tsx index 23edc9d..e25683e 100644 --- a/src/store.tsx +++ b/src/store.tsx @@ -58,6 +58,16 @@ interface MediaStore { clearAll: () => Promise /** Met à jour plusieurs fiches d'un coup (sans changer leur date de modification). */ patchMany: (patches: { id: string; patch: Partial }[]) => Promise + /** Modification groupée par l'utilisateur (la date de modification avance, comme update). */ + updateMany: (patches: { id: string; patch: Partial }[]) => Promise + /** Suppression groupée. */ + removeMany: (ids: string[]) => Promise + /** + * « Annuler » : remet ces fiches exactement comme elles étaient (dates, épisodes, listes…), + * avec une date de modification plus récente que la suppression / le changement, pour que + * la synchro (la plus récente gagne) recrée bien la fiche côté serveur. + */ + restore: (snapshots: MediaItem[]) => Promise // Listes perso lists: CustomList[] @@ -253,11 +263,61 @@ export function MediaProvider({ children, cloudUser }: { children: ReactNode; cl [save], ) + // Dernière suppression locale de chaque fiche (une restauration doit être strictement plus récente) + const removedAtRef = useRef(new Map()) + const remove = useCallback(async (id: string) => { await mediaDB.remove(id) + removedAtRef.current.set(id, Date.now()) setItems((prev) => prev.filter((i) => i.id !== id)) }, []) + const removeMany = useCallback(async (ids: string[]) => { + if (!ids.length) return + await mediaDB.removeMany(ids) + const now = Date.now() + for (const id of ids) removedAtRef.current.set(id, now) + const gone = new Set(ids) + setItems((prev) => prev.filter((i) => !gone.has(i.id))) + }, []) + + const updateMany = useCallback( + async (patches: { id: string; patch: Partial }[]) => { + const now = new Date().toISOString() + const byId = new Map(itemsRef.current.map((i) => [i.id, i])) + const changed = patches.flatMap(({ id, patch }) => { + const cur = byId.get(id) + const next = cur ? normalizeItem({ ...cur, ...patch, updatedAt: now }) : null + return next ? [next] : [] + }) + if (!changed.length) return + await mediaDB.putMany(changed) + const map = new Map(changed.map((c) => [c.id, c])) + setItems((prev) => prev.map((i) => map.get(i.id) ?? i).sort(byUpdatedDesc)) + }, + [setItems], + ) + + const restore = useCallback( + async (snapshots: MediaItem[]) => { + // Horodatage plus récent que la suppression (ou la modification) qu'on annule : la synchro + // envoie alors une version qui gagne sur la « pierre tombale » déjà partie au serveur. + const current = new Map(itemsRef.current.map((i) => [i.id, i.updatedAt])) + let latest = Date.now() + for (const snap of snapshots) { + latest = Math.max(latest, (removedAtRef.current.get(snap.id) ?? 0) + 1, (Date.parse(current.get(snap.id) ?? '') || 0) + 1) + } + const at = new Date(latest).toISOString() + const restored = snapshots.map((s) => normalizeItem({ ...s, updatedAt: at })).filter((i): i is MediaItem => i !== null) + if (!restored.length) return + await mediaDB.putMany(restored) + for (const r of restored) removedAtRef.current.delete(r.id) + const map = new Map(restored.map((r) => [r.id, r])) + setItems((prev) => [...restored, ...prev.filter((i) => !map.has(i.id))].sort(byUpdatedDesc)) + }, + [setItems], + ) + const incrementEpisode = useCallback( async (id: string, delta = 1) => { const item = itemsRef.current.find((i) => i.id === id) @@ -442,11 +502,11 @@ export function MediaProvider({ children, cloudUser }: { children: ReactNode; cl const value = useMemo( () => ({ items, loading, error, settings: exposedSettings, updateSettings, add, update, remove, incrementEpisode, importItems, setTopList, clearAll, - patchMany, lists, createList, renameList, deleteList, toggleInList, mergeLists, account, + patchMany, updateMany, removeMany, restore, lists, createList, renameList, deleteList, toggleInList, mergeLists, account, }), [ items, loading, error, exposedSettings, updateSettings, add, update, remove, incrementEpisode, importItems, setTopList, clearAll, - patchMany, lists, createList, renameList, deleteList, toggleInList, mergeLists, account, + patchMany, updateMany, removeMany, restore, lists, createList, renameList, deleteList, toggleInList, mergeLists, account, ], ) diff --git a/src/types.ts b/src/types.ts index ad7da63..acbbd63 100644 --- a/src/types.ts +++ b/src/types.ts @@ -49,6 +49,8 @@ export interface MediaItem { top?: TopEntry /** Listes perso auxquelles appartient la fiche. */ listIds?: string[] + /** Tags personnels libres (« comfort », « halloween »…). Privés : jamais affichés sur le profil public. */ + tags?: string[] /** Pays d'origine (codes ISO, ex. ['KR']). */ countries?: string[] /** Dates de revisionnage (AAAA-MM-JJ), en plus du premier visionnage. */ diff --git a/supabase/migrations/20261009110000_private_tags.sql b/supabase/migrations/20261009110000_private_tags.sql new file mode 100644 index 0000000..4671f44 --- /dev/null +++ b/supabase/migrations/20261009110000_private_tags.sql @@ -0,0 +1,24 @@ +-- ───────────────────────────────────────────────────────────────────────────── +-- Tags personnels (« comfort », « à revoir avec Léa »…) : PRIVÉS. +-- +-- Les tags vivent dans la fiche (colonne JSON `items.data`, champ `tags`) et suivent donc +-- la synchronisation existante sans nouvelle colonne. Ils ne doivent jamais apparaître +-- chez les autres : la fonction qui prépare une fiche pour un profil / le fil d'abonnements +-- les retire, comme les listes perso. +-- +-- Idempotent : peut être relancé sans risque (create or replace + revoke). +-- ───────────────────────────────────────────────────────────────────────────── + +create or replace function public.public_item(d jsonb) +returns jsonb +language sql +immutable +set search_path = '' +as $$ + select case when length(coalesce(x->>'poster', '')) > 150000 then x - 'poster' else x end + -- Les avis sont publics (comme sur Letterboxd) ; les listes perso et les tags perso restent privés + from (select d - 'listIds' - 'notesPublic' - 'tags' as x) s +$$; + +-- Outil interne des fonctions de profil : jamais appelable directement depuis l'API +revoke all on function public.public_item(jsonb) from public, anon, authenticated;