Social : avis avec spoilers, commentaires sous les avis, listes partagées
- Spoilers : case « Contient des spoilers » dans l'éditeur d'avis (notesSpoiler, synchronisé avec la fiche) ; texte retiré de la page (pas seulement flouté) jusqu'à « Afficher le spoiler » dans les avis d'un titre et l'aperçu d'une fiche ; badge sur mon avis. - Commentaires sous les avis (≤ 500 car.) : fil avec auteur, date relative, suppression (auteur / auteur de l'avis / admin), compteur à côté des réactions, notification « review_comment » (préférence notifPrefs.comments), anti-spam 10/min côté SQL. - Listes partagées : section dans l'onglet Listes, invitations (notification + acceptation), membres, qui a ajouté quoi, quitter / retirer un membre / supprimer, ajout depuis la fiche et depuis la bibliothèque, ouverture d'un titre (ma fiche ou fiche du catalogue). - SQL : 20261009130000_review_spoilers_comments.sql et 20261009130100_shared_lists.sql (RLS, aucun accès direct aux tables, fonctions security definer + search_path vide). - Tout se masque sans compte ou si les migrations ne sont pas encore appliquées. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
41 files changed
+3481
-21
No files matched your search
+1
-1
@@ -67,7 +67,7 @@ export default function App() {
|
||||
}
|
||||
|
||||
return (
|
||||
<SocialProvider onOpenOwnItem={openItem}>
|
||||
<SocialProvider onOpenOwnItem={openItem} onOpenSeed={(seed) => setOpened({ seed })}>
|
||||
<SideNav current={navTab} onChange={go} onAdd={openNew} />
|
||||
<div className="mx-auto min-h-dvh max-w-2xl lg:max-w-none lg:ps-60">
|
||||
<main className="safe-top px-4 pb-32 lg:px-10 lg:pb-10 2xl:px-14">
|
||||
|
||||
@@ -9,6 +9,7 @@ import ConfirmDialog from './ConfirmDialog'
|
||||
import { MediaCard } from './MediaCard'
|
||||
import Poster from './Poster'
|
||||
import { EmptyState } from './ui'
|
||||
import { SharedListsSection } from './social/SharedLists'
|
||||
|
||||
/** Mosaïque 2×2 des premières affiches d'une liste. */
|
||||
function Mosaic({ items }: { items: MediaItem[] }) {
|
||||
@@ -228,6 +229,9 @@ export default function ListsView({ onOpen }: { onOpen: (item: MediaItem) => voi
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Listes partagées avec d'autres membres (compte requis ; masqué sinon) */}
|
||||
<SharedListsSection />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { t } from '../../i18n'
|
||||
import { useMedia } from '../../store'
|
||||
import ReviewComments from './ReviewComments'
|
||||
import ReviewText from './ReviewText'
|
||||
import Sheet from './Sheet'
|
||||
|
||||
/** Commentaires sous un de mes avis, en plein écran (ouvert depuis une notification). */
|
||||
export default function CommentsSheet({ authorId, itemId, title, onClose }: { authorId: string; itemId: string; title: string; onClose: () => void }) {
|
||||
const { items } = useMedia()
|
||||
// Mon avis tel qu'il est sur cet appareil (les commentaires viennent du serveur)
|
||||
const mine = items.find((i) => i.id === itemId)
|
||||
return (
|
||||
<Sheet title={title || t('comments.title')} label={t('comments.title')} onClose={onClose} elevated>
|
||||
<div className="px-4 pt-4">
|
||||
{mine?.notes && (
|
||||
<article className="card mb-4 p-3.5">
|
||||
<p className="eyebrow">{t('form.review')}</p>
|
||||
<ReviewText text={mine.notes} spoiler={mine.notesSpoiler} revealed clamp />
|
||||
</article>
|
||||
)}
|
||||
<p className="eyebrow mb-1">{t('comments.title')}</p>
|
||||
<ReviewComments authorId={authorId} itemId={itemId} defaultOpen />
|
||||
</div>
|
||||
</Sheet>
|
||||
)
|
||||
}
|
||||
@@ -13,6 +13,8 @@ import { StatusPill, TypeBadge } from '../Badges'
|
||||
import Poster from '../Poster'
|
||||
import Avatar from './Avatar'
|
||||
import Reactions from './Reactions'
|
||||
import ReviewComments from './ReviewComments'
|
||||
import ReviewText from './ReviewText'
|
||||
import { useEscape } from '../../lib/escape'
|
||||
|
||||
export interface PeekOwner {
|
||||
@@ -126,10 +128,12 @@ export default function ItemPeek({ item, owner, onClose }: { item: MediaItem; ow
|
||||
{item.endDate && item.status === 'termine' && <span>{formatDate(item.endDate)}</span>}
|
||||
{item.favorite && <span className="text-accent">♥ {t('form.favorite')}</span>}
|
||||
</div>
|
||||
{item.notes && <p className="mt-3 whitespace-pre-line text-sm leading-relaxed text-ink-2">{item.notes}</p>}
|
||||
{item.notes && <ReviewText text={item.notes} spoiler={item.notesSpoiler} className="mt-3" />}
|
||||
{canReact && review && (
|
||||
<div className="mt-3 border-t border-line pt-3">
|
||||
<ReviewComments authorId={review.user_id} itemId={review.item_id} count={review.comments} hidden={review.comments === null}>
|
||||
<Reactions authorId={review.user_id} itemId={review.item_id} reactions={review.reactions} mine={review.mine} />
|
||||
</ReviewComments>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { Loader2, Tv } from 'lucide-react'
|
||||
import { Check, Loader2, MessageCircle, Tv, Users } from 'lucide-react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { t } from '../../i18n'
|
||||
import { listNotifications, markNotificationsRead, type AppNotification, type NotificationKind } from '../../lib/cloud/notifications'
|
||||
import { cx, formatDate } from '../../lib/utils'
|
||||
import { EmptyState } from '../ui'
|
||||
import Avatar from './Avatar'
|
||||
import { respondToInvite } from '../../lib/cloud/sharedLists'
|
||||
import { useSocial } from './SocialProvider'
|
||||
import Sheet from './Sheet'
|
||||
|
||||
const PAGE = 30
|
||||
@@ -18,10 +20,24 @@ const VERB: Record<NotificationKind, () => string> = {
|
||||
reaction: () => t('notif.reaction'),
|
||||
new_episode: () => '',
|
||||
new_season: () => '',
|
||||
review_comment: () => t('notif.review_comment'),
|
||||
shared_list_invite: () => t('notif.shared_list_invite'),
|
||||
}
|
||||
|
||||
/** Liste des notifications (abonnements, réactions, nouveaux épisodes). Marque comme lues à l'ouverture. */
|
||||
export default function Notifications({ onClose, onOpenProfile, onOpenItem }: { onClose: () => void; onOpenProfile: (username: string) => void; onOpenItem: (itemId: string) => void }) {
|
||||
export default function Notifications({
|
||||
onClose,
|
||||
onOpenProfile,
|
||||
onOpenItem,
|
||||
onOpenComments,
|
||||
onOpenSharedList,
|
||||
}: {
|
||||
onClose: () => void
|
||||
onOpenProfile: (username: string) => void
|
||||
onOpenItem: (itemId: string) => void
|
||||
onOpenComments?: (itemId: string, title: string) => void
|
||||
onOpenSharedList?: (listId: string) => void
|
||||
}) {
|
||||
const [items, setItems] = useState<AppNotification[] | undefined>(undefined)
|
||||
const [done, setDone] = useState(false)
|
||||
const [loadingMore, setLoadingMore] = useState(false)
|
||||
@@ -74,7 +90,7 @@ export default function Notifications({ onClose, onOpenProfile, onOpenItem }: {
|
||||
) : (
|
||||
<ul>
|
||||
{items.map((n) => (
|
||||
<Row key={n.id} n={n} onOpenProfile={onOpenProfile} onOpenItem={onOpenItem} />
|
||||
<Row key={n.id} n={n} onOpenProfile={onOpenProfile} onOpenItem={onOpenItem} onOpenComments={onOpenComments} onOpenSharedList={onOpenSharedList} />
|
||||
))}
|
||||
{!done && (
|
||||
<li className="p-4">
|
||||
@@ -89,7 +105,19 @@ export default function Notifications({ onClose, onOpenProfile, onOpenItem }: {
|
||||
)
|
||||
}
|
||||
|
||||
function Row({ n, onOpenProfile, onOpenItem }: { n: AppNotification; onOpenProfile: (username: string) => void; onOpenItem: (itemId: string) => void }) {
|
||||
function Row({
|
||||
n,
|
||||
onOpenProfile,
|
||||
onOpenItem,
|
||||
onOpenComments,
|
||||
onOpenSharedList,
|
||||
}: {
|
||||
n: AppNotification
|
||||
onOpenProfile: (username: string) => void
|
||||
onOpenItem: (itemId: string) => void
|
||||
onOpenComments?: (itemId: string, title: string) => void
|
||||
onOpenSharedList?: (listId: string) => void
|
||||
}) {
|
||||
const unread = n.read_at === null
|
||||
const isEpisode = EPISODE_KINDS.includes(n.kind)
|
||||
const base = cx('flex items-center gap-3 border-b border-line px-4 py-3 text-start', unread && 'bg-surface-2')
|
||||
@@ -123,6 +151,11 @@ function Row({ n, onOpenProfile, onOpenItem }: { n: AppNotification; onOpenProfi
|
||||
)
|
||||
}
|
||||
|
||||
// ── Commentaire sur mon avis / invitation à une liste partagée ──
|
||||
if (n.kind === 'review_comment' || n.kind === 'shared_list_invite') {
|
||||
return <SocialRow n={n} base={base} unread={unread} onOpenProfile={onOpenProfile} onOpenComments={onOpenComments} onOpenSharedList={onOpenSharedList} />
|
||||
}
|
||||
|
||||
// ── Abonnements / réactions ──
|
||||
const actor = n.actor
|
||||
const actorName = actor?.display_name ?? t('notif.someone')
|
||||
@@ -158,3 +191,99 @@ function Row({ n, onOpenProfile, onOpenItem }: { n: AppNotification; onOpenProfi
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
||||
function SocialRow({
|
||||
n,
|
||||
base,
|
||||
unread,
|
||||
onOpenProfile,
|
||||
onOpenComments,
|
||||
onOpenSharedList,
|
||||
}: {
|
||||
n: AppNotification
|
||||
base: string
|
||||
unread: boolean
|
||||
onOpenProfile: (username: string) => void
|
||||
onOpenComments?: (itemId: string, title: string) => void
|
||||
onOpenSharedList?: (listId: string) => void
|
||||
}) {
|
||||
const social = useSocial()
|
||||
const [status, setStatus] = useState(n.invite_status)
|
||||
const [busy, setBusy] = useState(false)
|
||||
const actor = n.actor
|
||||
const actorName = actor?.display_name ?? t('notif.someone')
|
||||
const isInvite = n.kind === 'shared_list_invite'
|
||||
|
||||
const respond = async (accept: boolean) => {
|
||||
if (!n.item_id) return
|
||||
setBusy(true)
|
||||
try {
|
||||
await respondToInvite(n.item_id, accept)
|
||||
setStatus(accept ? 'accepted' : null)
|
||||
social.bumpShared()
|
||||
if (accept) onOpenSharedList?.(n.item_id)
|
||||
} catch {
|
||||
/* invitation expirée ou réseau : rien ne change */
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
// Où mène un tap sur la ligne
|
||||
const open =
|
||||
!isInvite && n.item_id && onOpenComments
|
||||
? () => onOpenComments(n.item_id!, n.title ?? '')
|
||||
: isInvite && status === 'accepted' && n.item_id && onOpenSharedList
|
||||
? () => onOpenSharedList(n.item_id!)
|
||||
: null
|
||||
|
||||
const text = (
|
||||
<span className="min-w-0 flex-1 text-sm leading-snug text-ink-2">
|
||||
<b className="text-ink">{actorName}</b> {VERB[n.kind]()}
|
||||
{isInvite ? (
|
||||
n.title ? (
|
||||
<>
|
||||
{' '}
|
||||
<b className="text-ink">{n.title}</b>
|
||||
</>
|
||||
) : (
|
||||
` (${t('shared.expired')})`
|
||||
)
|
||||
) : n.title ? (
|
||||
` ${t('notif.on', { title: n.title })}`
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</span>
|
||||
)
|
||||
|
||||
return (
|
||||
<li>
|
||||
<div className={cx(base, 'flex-wrap')}>
|
||||
{unread && <span className="size-2 shrink-0 rounded-full bg-accent-fill" aria-hidden="true" />}
|
||||
<button type="button" onClick={() => actor && onOpenProfile(actor.username)} className="shrink-0" aria-label={actorName} disabled={!actor}>
|
||||
<Avatar url={actor?.avatar_url ?? undefined} name={actorName} size={38} />
|
||||
</button>
|
||||
{open ? (
|
||||
<button type="button" onClick={open} className="flex min-w-0 flex-1 items-center gap-2 text-start">
|
||||
{isInvite ? <Users size={14} className="shrink-0 text-accent" aria-hidden="true" /> : <MessageCircle size={14} className="shrink-0 text-accent" aria-hidden="true" />}
|
||||
{text}
|
||||
</button>
|
||||
) : (
|
||||
text
|
||||
)}
|
||||
<span className="shrink-0 text-xs text-ink-3">{formatDate(n.created_at)}</span>
|
||||
{isInvite && status === 'pending' && n.title && (
|
||||
<div className="flex w-full justify-end gap-2 ps-[3.25rem]">
|
||||
<button type="button" onClick={() => void respond(false)} disabled={busy} className="btn btn-ghost px-3.5 py-1.5 text-sm">
|
||||
{t('shared.decline')}
|
||||
</button>
|
||||
<button type="button" onClick={() => void respond(true)} disabled={busy} className="btn btn-primary px-3.5 py-1.5 text-sm">
|
||||
{busy ? <Loader2 size={14} className="animate-spin" /> : <Check size={14} />} {t('shared.accept')}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
import { Loader2, MessageCircle, Send, Trash2 } from 'lucide-react'
|
||||
import { useEffect, useRef, useState, type ReactNode } from 'react'
|
||||
import { t } from '../../i18n'
|
||||
import { addReviewComment, COMMENT_MAX, CommentsUnavailable, deleteReviewComment, getReviewComments, type ReviewComment } from '../../lib/cloud/comments'
|
||||
import { timeAgo } from '../../lib/timeAgo'
|
||||
import { cx } from '../../lib/utils'
|
||||
import Avatar from './Avatar'
|
||||
import { useSocial } from './SocialProvider'
|
||||
|
||||
/**
|
||||
* Bouton « commentaires » (avec leur nombre) placé à côté des réactions, et fil de commentaires
|
||||
* qui s'ouvre sous l'avis. `children` = les autres actions de la ligne (réactions).
|
||||
*/
|
||||
export default function ReviewComments({
|
||||
authorId,
|
||||
itemId,
|
||||
count: initialCount,
|
||||
defaultOpen,
|
||||
hidden,
|
||||
children,
|
||||
}: {
|
||||
authorId: string
|
||||
itemId: string
|
||||
/** Nombre connu (sinon chargé à l'ouverture) */
|
||||
count?: number | null
|
||||
defaultOpen?: boolean
|
||||
/** Serveur sans les commentaires (migration pas encore appliquée) : seules les autres actions s'affichent */
|
||||
hidden?: boolean
|
||||
children?: ReactNode
|
||||
}) {
|
||||
const social = useSocial()
|
||||
const [open, setOpen] = useState(!!defaultOpen)
|
||||
const [count, setCount] = useState(initialCount ?? undefined)
|
||||
const [comments, setComments] = useState<ReviewComment[]>()
|
||||
const [unavailable, setUnavailable] = useState(false)
|
||||
const [loadError, setLoadError] = useState(false)
|
||||
|
||||
// Fil chargé à l'ouverture (ou tout de suite si on ne connaît pas encore le nombre)
|
||||
const shouldLoad = !hidden && (open || initialCount === undefined)
|
||||
useEffect(() => {
|
||||
if (!shouldLoad || comments || unavailable) return
|
||||
let alive = true
|
||||
getReviewComments(authorId, itemId)
|
||||
.then((th) => {
|
||||
if (!alive) return
|
||||
setComments(th.comments)
|
||||
setCount(th.comments.length)
|
||||
})
|
||||
.catch((e) => {
|
||||
if (!alive) return
|
||||
if (e instanceof CommentsUnavailable) setUnavailable(true)
|
||||
else setLoadError(true)
|
||||
})
|
||||
return () => {
|
||||
alive = false
|
||||
}
|
||||
}, [shouldLoad, comments, unavailable, authorId, itemId])
|
||||
|
||||
if (!social.enabled || hidden) return <>{children}</>
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="flex flex-wrap items-center gap-1.5">
|
||||
{children}
|
||||
{!unavailable && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setOpen((v) => !v)}
|
||||
aria-expanded={open}
|
||||
aria-label={t('comments.toggle', { count: count ?? 0 })}
|
||||
className={cx(
|
||||
'inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-sm transition-colors active:scale-95',
|
||||
open ? 'border-ink/60 text-ink' : 'border-line text-ink-2',
|
||||
)}
|
||||
>
|
||||
<MessageCircle size={15} aria-hidden="true" />
|
||||
{(count ?? 0) > 0 && <span className="text-xs font-medium">{count}</span>}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
{open && !unavailable && (
|
||||
<Thread
|
||||
comments={comments}
|
||||
error={loadError}
|
||||
onOpenProfile={social.openProfile}
|
||||
onAdd={async (body) => {
|
||||
const c = await addReviewComment(authorId, itemId, body)
|
||||
setComments((prev) => [...(prev ?? []), c])
|
||||
setCount((n) => (n ?? 0) + 1)
|
||||
}}
|
||||
onDelete={async (id) => {
|
||||
await deleteReviewComment(id)
|
||||
setComments((prev) => prev?.filter((c) => c.id !== id))
|
||||
setCount((n) => Math.max(0, (n ?? 1) - 1))
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function Thread({
|
||||
comments,
|
||||
error,
|
||||
onOpenProfile,
|
||||
onAdd,
|
||||
onDelete,
|
||||
}: {
|
||||
comments?: ReviewComment[]
|
||||
error: boolean
|
||||
onOpenProfile: (username: string) => void
|
||||
onAdd: (body: string) => Promise<void>
|
||||
onDelete: (id: number) => Promise<void>
|
||||
}) {
|
||||
const [text, setText] = useState('')
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [err, setErr] = useState<string>()
|
||||
const [confirmId, setConfirmId] = useState<number>()
|
||||
const [deleting, setDeleting] = useState<number>()
|
||||
const area = useRef<HTMLTextAreaElement>(null)
|
||||
|
||||
const submit = async () => {
|
||||
const body = text.trim()
|
||||
if (!body || busy) return
|
||||
setBusy(true)
|
||||
setErr(undefined)
|
||||
try {
|
||||
await onAdd(body)
|
||||
setText('')
|
||||
if (area.current) area.current.style.height = ''
|
||||
} catch (e) {
|
||||
setErr((e as Error).message)
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
const remove = async (id: number) => {
|
||||
setDeleting(id)
|
||||
try {
|
||||
await onDelete(id)
|
||||
} catch (e) {
|
||||
setErr((e as Error).message)
|
||||
} finally {
|
||||
setDeleting(undefined)
|
||||
setConfirmId(undefined)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mt-3 border-t border-line pt-3">
|
||||
{comments === undefined ? (
|
||||
error ? (
|
||||
<p className="text-xs text-ink-3">{t('comments.loadError')}</p>
|
||||
) : (
|
||||
<p className="flex items-center gap-2 text-xs text-ink-3">
|
||||
<Loader2 size={13} className="animate-spin" /> {t('social.loading')}
|
||||
</p>
|
||||
)
|
||||
) : comments.length === 0 ? (
|
||||
<p className="text-xs text-ink-3">{t('comments.none')}</p>
|
||||
) : (
|
||||
<ul className="space-y-3">
|
||||
{comments.map((c) => (
|
||||
<li key={c.id} className="flex gap-2.5">
|
||||
<button type="button" onClick={() => onOpenProfile(c.user.username)} className="shrink-0" aria-label={c.user.displayName}>
|
||||
<Avatar url={c.user.avatarUrl} name={c.user.displayName} size={28} />
|
||||
</button>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<button type="button" onClick={() => onOpenProfile(c.user.username)} className="min-w-0 truncate text-start text-[13px] font-semibold text-ink">
|
||||
{c.user.displayName}
|
||||
</button>
|
||||
<span className="shrink-0 text-[11px] text-ink-3">{timeAgo(c.createdAt)}</span>
|
||||
{c.canDelete && confirmId !== c.id && (
|
||||
<button type="button" onClick={() => setConfirmId(c.id)} className="ms-auto grid size-7 shrink-0 place-items-center rounded-full text-ink-3" aria-label={t('comments.delete')}>
|
||||
<Trash2 size={14} />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
<p className="whitespace-pre-line break-words text-sm leading-relaxed text-ink-2">{c.body}</p>
|
||||
{confirmId === c.id && (
|
||||
<div className="mt-1.5 flex items-center gap-2 text-xs">
|
||||
<span className="text-ink-3">{t('comments.deleteConfirm')}</span>
|
||||
<button type="button" onClick={() => void remove(c.id)} disabled={deleting === c.id} className="rounded-full bg-accent-fill px-2.5 py-1 font-semibold text-on-accent disabled:opacity-60">
|
||||
{deleting === c.id ? <Loader2 size={12} className="animate-spin" /> : t('common.delete')}
|
||||
</button>
|
||||
<button type="button" onClick={() => setConfirmId(undefined)} className="rounded-full border border-line px-2.5 py-1 text-ink-2">
|
||||
{t('common.cancel')}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
<form
|
||||
className="mt-3 flex items-end gap-2"
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault()
|
||||
void submit()
|
||||
}}
|
||||
>
|
||||
<label className="min-w-0 flex-1">
|
||||
<span className="sr-only">{t('comments.placeholder')}</span>
|
||||
<textarea
|
||||
ref={area}
|
||||
rows={1}
|
||||
value={text}
|
||||
maxLength={COMMENT_MAX}
|
||||
onChange={(e) => {
|
||||
setText(e.target.value)
|
||||
// Le champ grandit avec le texte (jusqu'à ~6 lignes)
|
||||
e.target.style.height = 'auto'
|
||||
e.target.style.height = `${Math.min(e.target.scrollHeight, 160)}px`
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {
|
||||
e.preventDefault()
|
||||
void submit()
|
||||
}
|
||||
}}
|
||||
placeholder={t('comments.placeholder')}
|
||||
className="field block resize-none py-2 text-sm leading-snug"
|
||||
/>
|
||||
</label>
|
||||
<button type="submit" disabled={busy || !text.trim()} className="btn btn-primary size-10 shrink-0 p-0" aria-label={t('comments.send')}>
|
||||
{busy ? <Loader2 size={16} className="animate-spin" /> : <Send size={16} className="rtl:-scale-x-100" />}
|
||||
</button>
|
||||
</form>
|
||||
{text.length > COMMENT_MAX - 100 && (
|
||||
<p className={cx('mt-1 text-end text-[11px]', text.length >= COMMENT_MAX ? 'text-accent' : 'text-ink-3')}>
|
||||
{text.length}/{COMMENT_MAX}
|
||||
</p>
|
||||
)}
|
||||
{err && (
|
||||
<p role="alert" className="mt-1.5 text-xs text-accent">
|
||||
{err}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import { EyeOff } from 'lucide-react'
|
||||
import { useState } from 'react'
|
||||
import { t } from '../../i18n'
|
||||
import { cx } from '../../lib/utils'
|
||||
|
||||
/**
|
||||
* Texte d'un avis. Avec spoilers : le texte n'est PAS dans la page tant qu'on n'a pas tapé
|
||||
* « Afficher le spoiler » (pas seulement flouté : rien à lire pour un lecteur d'écran ni à copier).
|
||||
*/
|
||||
export default function ReviewText({
|
||||
text,
|
||||
spoiler,
|
||||
className,
|
||||
clamp,
|
||||
revealed,
|
||||
}: {
|
||||
text: string
|
||||
spoiler?: boolean
|
||||
className?: string
|
||||
clamp?: boolean
|
||||
/** Déjà dévoilé (mon propre avis) : seul le badge « Spoiler » reste */
|
||||
revealed?: boolean
|
||||
}) {
|
||||
const [shown, setShown] = useState(!spoiler || !!revealed)
|
||||
|
||||
if (!shown) {
|
||||
return (
|
||||
<div className={cx('relative mt-2 overflow-hidden rounded-xl border border-line bg-surface-2 px-3.5 py-3', className)}>
|
||||
{/* Fausses lignes floutées : purement décoratives */}
|
||||
<div aria-hidden="true" className="space-y-2 blur-[3px]">
|
||||
<span className="block h-2.5 w-11/12 rounded-full bg-ink-3/40" />
|
||||
<span className="block h-2.5 w-4/5 rounded-full bg-ink-3/40" />
|
||||
<span className="block h-2.5 w-3/5 rounded-full bg-ink-3/40" />
|
||||
</div>
|
||||
<div className="absolute inset-0 flex flex-wrap items-center justify-center gap-x-3 gap-y-1.5 px-3">
|
||||
<span className="flex items-center gap-1.5 text-xs font-semibold text-ink-2">
|
||||
<EyeOff size={14} className="text-accent" aria-hidden="true" /> {t('spoiler.warning')}
|
||||
</span>
|
||||
<button type="button" onClick={() => setShown(true)} className="rounded-full border border-line-strong bg-surface px-3 py-1 text-xs font-semibold text-ink active:scale-95">
|
||||
{t('spoiler.show')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={cx('mt-2', className)}>
|
||||
{spoiler && (
|
||||
<span className="mb-1.5 inline-flex items-center gap-1 rounded-full border border-accent/50 px-2 py-0.5 text-[11px] font-semibold uppercase tracking-wide text-accent">
|
||||
<EyeOff size={11} aria-hidden="true" /> {t('spoiler.badge')}
|
||||
</span>
|
||||
)}
|
||||
<p className={cx('whitespace-pre-line break-words text-sm leading-relaxed text-ink-2', clamp && 'line-clamp-6')}>{text}</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import { Check, Loader2, Users } from 'lucide-react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { t } from '../../i18n'
|
||||
import { getTmdbPosterUrl } from '../../lib/catalogApi'
|
||||
import { addSharedListItem, getSharedLists, removeSharedListItem, snapshotOf, type SharedListCard } from '../../lib/cloud/sharedLists'
|
||||
import { cx } from '../../lib/utils'
|
||||
import { useMedia } from '../../store'
|
||||
import type { MediaItem } from '../../types'
|
||||
import { useSocial } from './SocialProvider'
|
||||
|
||||
/**
|
||||
* « Ajouter à une liste » côté listes partagées, dans la fiche d'un titre.
|
||||
* N'apparaît que si j'ai au moins une liste partagée (et si le serveur les gère déjà).
|
||||
*/
|
||||
export default function SharedListPicker({ snapshot, posterFallback }: { snapshot: Pick<MediaItem, 'externalId' | 'title' | 'type' | 'year' | 'poster'>; posterFallback?: string }) {
|
||||
const social = useSocial()
|
||||
const { settings } = useMedia()
|
||||
const [lists, setLists] = useState<SharedListCard[]>()
|
||||
const [busy, setBusy] = useState<string>()
|
||||
const [err, setErr] = useState<string>()
|
||||
const externalId = snapshot.externalId
|
||||
|
||||
useEffect(() => {
|
||||
if (!social.enabled || !externalId) return
|
||||
let alive = true
|
||||
getSharedLists(externalId)
|
||||
.then((d) => alive && setLists(d.lists))
|
||||
.catch(() => alive && setLists([]))
|
||||
return () => {
|
||||
alive = false
|
||||
}
|
||||
}, [social.enabled, externalId, social.sharedTick])
|
||||
|
||||
if (!social.enabled || !lists?.length) return null
|
||||
|
||||
const toggle = async (l: SharedListCard) => {
|
||||
const snap = snapshotOf(snapshot, posterFallback)
|
||||
if (!snap) return
|
||||
setBusy(l.id)
|
||||
setErr(undefined)
|
||||
try {
|
||||
if (l.has) await removeSharedListItem(l.id, snap.externalId)
|
||||
else {
|
||||
// L'affiche gardée hors-ligne (copie locale) ne se partage pas : on reprend l'adresse TMDB
|
||||
if (!snap.poster && snap.externalId.startsWith('tmdb:') && settings.tmdbKey && navigator.onLine) {
|
||||
snap.poster = await getTmdbPosterUrl(snap.externalId, settings.tmdbKey).catch(() => undefined)
|
||||
}
|
||||
await addSharedListItem(l.id, snap)
|
||||
}
|
||||
setLists((prev) => prev?.map((x) => (x.id === l.id ? { ...x, has: !l.has, count: x.count + (l.has ? -1 : 1) } : x)))
|
||||
social.bumpShared()
|
||||
} catch (e) {
|
||||
setErr((e as Error).message)
|
||||
} finally {
|
||||
setBusy(undefined)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="mx-4 mt-8 border-t border-line pt-5" aria-labelledby="shared-picker-title">
|
||||
<h3 id="shared-picker-title" className="eyebrow mb-3 flex items-center gap-1.5 text-ink-2">
|
||||
<Users size={13} aria-hidden="true" /> {t('shared.addTo')}
|
||||
</h3>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{lists.map((l) => (
|
||||
<button key={l.id} onClick={() => void toggle(l)} disabled={busy === l.id} aria-pressed={l.has} className={cx('chip', l.has && 'chip-on')}>
|
||||
{busy === l.id ? <Loader2 size={14} className="animate-spin" /> : l.has ? <Check size={14} /> : <Users size={14} />}
|
||||
{l.name}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{err && (
|
||||
<p role="alert" className="mt-2 text-xs text-accent">
|
||||
{err}
|
||||
</p>
|
||||
)}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,613 @@
|
||||
import { Check, Loader2, LogOut, Pencil, Plus, Search, Trash2, UserPlus, Users, X } from 'lucide-react'
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { locale, t } from '../../i18n'
|
||||
import {
|
||||
addSharedListItem,
|
||||
createSharedList,
|
||||
deleteSharedList,
|
||||
getSharedList,
|
||||
getSharedLists,
|
||||
inviteCandidates,
|
||||
inviteToSharedList,
|
||||
leaveSharedList,
|
||||
removeSharedListItem,
|
||||
removeSharedListMember,
|
||||
renameSharedList,
|
||||
respondToInvite,
|
||||
SHARED_LIST_NAME_MAX,
|
||||
SharedListsUnavailable,
|
||||
snapshotOf,
|
||||
type SharedList,
|
||||
type SharedListCard,
|
||||
type SharedListInvite,
|
||||
type SharedListItem,
|
||||
} from '../../lib/cloud/sharedLists'
|
||||
import type { ProfileCard } from '../../lib/cloud/social'
|
||||
import { TYPE_BY_VALUE } from '../../lib/constants'
|
||||
import { cx, normalizeText } from '../../lib/utils'
|
||||
import { useMedia } from '../../store'
|
||||
import { TypeBadge } from '../Badges'
|
||||
import ConfirmDialog from '../ConfirmDialog'
|
||||
import Poster from '../Poster'
|
||||
import { EmptyState } from '../ui'
|
||||
import Avatar from './Avatar'
|
||||
import PersonRow from './PersonRow'
|
||||
import Sheet from './Sheet'
|
||||
import { useSocial } from './SocialProvider'
|
||||
|
||||
/** Mosaïque 2×2 des dernières affiches d'une liste partagée. */
|
||||
function PosterMosaic({ posters }: { posters: string[] }) {
|
||||
return (
|
||||
<div className="relative grid grid-cols-2 gap-0.5 overflow-hidden rounded-xl border border-line bg-surface-2">
|
||||
{[0, 1, 2, 3].map((i) =>
|
||||
posters[i] ? (
|
||||
<img key={i} src={posters[i]} alt="" loading="lazy" className="aspect-[2/3] w-full object-cover" />
|
||||
) : (
|
||||
<div key={i} className="aspect-[2/3] w-full bg-surface-2" />
|
||||
),
|
||||
)}
|
||||
<span className="absolute bottom-1.5 end-1.5 grid size-7 place-items-center rounded-full bg-bg/85 text-ink" aria-hidden="true">
|
||||
<Users size={14} />
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** Champ « nom de liste » + bouton (création, renommage). */
|
||||
function NameForm({ initial = '', submitLabel, onSubmit, onCancel, autoFocus }: { initial?: string; submitLabel: string; onSubmit: (name: string) => Promise<void>; onCancel?: () => void; autoFocus?: boolean }) {
|
||||
const [name, setName] = useState(initial)
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [err, setErr] = useState<string>()
|
||||
const submit = async () => {
|
||||
if (!name.trim() || busy) return
|
||||
setBusy(true)
|
||||
setErr(undefined)
|
||||
try {
|
||||
await onSubmit(name.trim())
|
||||
setName('')
|
||||
} catch (e) {
|
||||
setErr((e as Error).message)
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<div className="flex gap-2">
|
||||
<input
|
||||
className="field"
|
||||
value={name}
|
||||
maxLength={SHARED_LIST_NAME_MAX}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
void submit()
|
||||
}
|
||||
if (e.key === 'Escape' && onCancel) {
|
||||
e.stopPropagation()
|
||||
onCancel()
|
||||
}
|
||||
}}
|
||||
placeholder={t('shared.namePh')}
|
||||
autoFocus={autoFocus}
|
||||
enterKeyHint="done"
|
||||
aria-label={t('shared.namePh')}
|
||||
/>
|
||||
<button type="button" onClick={() => void submit()} disabled={!name.trim() || busy} className="btn btn-light shrink-0 px-4 text-sm">
|
||||
{busy ? <Loader2 size={15} className="animate-spin" /> : submitLabel}
|
||||
</button>
|
||||
</div>
|
||||
{err && (
|
||||
<p role="alert" className="mt-1.5 text-xs text-accent">
|
||||
{err}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// ════════════════════════ Section « Listes partagées » (onglet Listes) ════════════════════════
|
||||
|
||||
export function SharedListsSection() {
|
||||
const social = useSocial()
|
||||
const [data, setData] = useState<{ lists: SharedListCard[]; invites: SharedListInvite[] }>()
|
||||
const [unavailable, setUnavailable] = useState(false)
|
||||
const [creating, setCreating] = useState(false)
|
||||
const [busyInvite, setBusyInvite] = useState<string>()
|
||||
|
||||
useEffect(() => {
|
||||
if (!social.enabled) return
|
||||
let alive = true
|
||||
getSharedLists()
|
||||
.then((d) => alive && setData(d))
|
||||
.catch((e) => {
|
||||
if (!alive) return
|
||||
if (e instanceof SharedListsUnavailable) setUnavailable(true)
|
||||
else setData((prev) => prev ?? { lists: [], invites: [] })
|
||||
})
|
||||
return () => {
|
||||
alive = false
|
||||
}
|
||||
}, [social.enabled, social.sharedTick])
|
||||
|
||||
// Sans compte, ou serveur pas encore à jour : la section n'existe pas
|
||||
if (!social.enabled || unavailable) return null
|
||||
|
||||
const respond = async (inv: SharedListInvite, accept: boolean) => {
|
||||
setBusyInvite(inv.id)
|
||||
try {
|
||||
await respondToInvite(inv.id, accept)
|
||||
social.bumpShared()
|
||||
if (accept) social.openSharedList(inv.id)
|
||||
} catch {
|
||||
/* l'invitation reste affichée */
|
||||
} finally {
|
||||
setBusyInvite(undefined)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="mt-10 border-t border-line pt-6" aria-labelledby="shared-lists-title">
|
||||
<div className="mb-1 flex items-center justify-between gap-3">
|
||||
<h2 id="shared-lists-title" className="flex items-center gap-2 text-lg">
|
||||
<Users size={18} className="text-accent" aria-hidden="true" /> {t('shared.title')}
|
||||
</h2>
|
||||
</div>
|
||||
<p className="mb-4 text-sm text-ink-3">{t('shared.hint')}</p>
|
||||
|
||||
{creating ? (
|
||||
<div className="mb-5">
|
||||
<NameForm
|
||||
autoFocus
|
||||
submitLabel={t('lists.create')}
|
||||
onCancel={() => setCreating(false)}
|
||||
onSubmit={async (name) => {
|
||||
const id = await createSharedList(name)
|
||||
setCreating(false)
|
||||
social.bumpShared()
|
||||
social.openSharedList(id)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<button onClick={() => setCreating(true)} className="chip mb-5">
|
||||
<Plus size={14} /> {t('shared.new')}
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* Invitations reçues */}
|
||||
{data && data.invites.length > 0 && (
|
||||
<ul className="mb-6 space-y-2">
|
||||
{data.invites.map((inv) => (
|
||||
<li key={inv.id} className="card p-3.5 sm:flex sm:items-center sm:gap-3">
|
||||
<div className="flex min-w-0 flex-1 items-center gap-3">
|
||||
<Avatar url={inv.owner?.avatarUrl} name={inv.owner?.displayName ?? '?'} size={36} />
|
||||
<p className="min-w-0 flex-1 text-sm leading-snug text-ink-2">
|
||||
<b className="text-ink">{inv.owner?.displayName ?? t('notif.someone')}</b> {t('shared.invitesYou')} <b className="text-ink">{inv.name}</b>
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-3 flex shrink-0 justify-end gap-2 sm:mt-0">
|
||||
<button onClick={() => void respond(inv, false)} disabled={busyInvite === inv.id} className="btn btn-ghost px-3.5 py-1.5 text-sm">
|
||||
{t('shared.decline')}
|
||||
</button>
|
||||
<button onClick={() => void respond(inv, true)} disabled={busyInvite === inv.id} className="btn btn-primary px-3.5 py-1.5 text-sm">
|
||||
{busyInvite === inv.id ? <Loader2 size={14} className="animate-spin" /> : <Check size={14} />} {t('shared.accept')}
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{data === undefined ? (
|
||||
<p className="flex items-center gap-2 text-sm text-ink-3">
|
||||
<Loader2 size={14} className="animate-spin" /> {t('social.loading')}
|
||||
</p>
|
||||
) : data.lists.length === 0 ? (
|
||||
<p className="rounded-2xl border border-dashed border-line-strong p-4 text-sm text-ink-3">{t('shared.none')}</p>
|
||||
) : (
|
||||
<div className="grid grid-cols-2 gap-x-3.5 gap-y-6 sm:grid-cols-3 lg:grid-cols-5 xl:grid-cols-6 2xl:grid-cols-8">
|
||||
{data.lists.map((l) => (
|
||||
<button key={l.id} onClick={() => social.openSharedList(l.id)} className="text-start">
|
||||
<PosterMosaic posters={l.posters} />
|
||||
<p className="mt-2 truncate text-sm font-semibold">{l.name}</p>
|
||||
<p className="truncate text-xs text-ink-3">
|
||||
{t('account.nTitles', { count: l.count })} · {t('shared.nMembers', { count: l.members })}
|
||||
</p>
|
||||
{!l.isOwner && l.owner && <p className="truncate text-[11px] text-ink-3">{t('shared.by', { name: l.owner.displayName })}</p>}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
// ════════════════════════ Une liste partagée (plein écran) ════════════════════════
|
||||
|
||||
export function SharedListSheet({ id, onClose }: { id: string; onClose: () => void }) {
|
||||
const social = useSocial()
|
||||
const [list, setList] = useState<SharedList | null>()
|
||||
const [error, setError] = useState<string>()
|
||||
const [renaming, setRenaming] = useState(false)
|
||||
const [editing, setEditing] = useState(false)
|
||||
const [confirm, setConfirm] = useState<'delete' | 'leave' | null>(null)
|
||||
const [busyKey, setBusyKey] = useState<string>()
|
||||
const [reload, setReload] = useState(0)
|
||||
|
||||
useEffect(() => {
|
||||
let alive = true
|
||||
getSharedList(id)
|
||||
.then((l) => alive && setList(l))
|
||||
.catch((e) => alive && (setError((e as Error).message), setList(null)))
|
||||
return () => {
|
||||
alive = false
|
||||
}
|
||||
}, [id, reload, social.sharedTick])
|
||||
|
||||
const refresh = () => setReload((n) => n + 1)
|
||||
|
||||
const act = async (key: string, fn: () => Promise<unknown>) => {
|
||||
setBusyKey(key)
|
||||
setError(undefined)
|
||||
try {
|
||||
await fn()
|
||||
refresh()
|
||||
social.bumpShared()
|
||||
} catch (e) {
|
||||
setError((e as Error).message)
|
||||
} finally {
|
||||
setBusyKey(undefined)
|
||||
}
|
||||
}
|
||||
|
||||
const accepted = list?.members.filter((m) => m.status === 'accepted') ?? []
|
||||
const pending = list?.members.filter((m) => m.status === 'pending') ?? []
|
||||
|
||||
return (
|
||||
<Sheet title={list?.name ?? t('shared.title')} label={list?.name ?? t('shared.title')} onClose={onClose} wide>
|
||||
{list === undefined ? (
|
||||
<p className="flex items-center justify-center py-16 text-ink-3">
|
||||
<Loader2 size={20} className="animate-spin" />
|
||||
</p>
|
||||
) : list === null ? (
|
||||
<div className="px-4">
|
||||
<EmptyState title={t('shared.notFound')} text={error} />
|
||||
</div>
|
||||
) : (
|
||||
<div className="px-4 pt-5 lg:px-8">
|
||||
{/* Nom + compteurs */}
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
{renaming ? (
|
||||
<div className="flex-1">
|
||||
<NameForm
|
||||
autoFocus
|
||||
initial={list.name}
|
||||
submitLabel="OK"
|
||||
onCancel={() => setRenaming(false)}
|
||||
onSubmit={async (name) => {
|
||||
await renameSharedList(list.id, name)
|
||||
setRenaming(false)
|
||||
refresh()
|
||||
social.bumpShared()
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="min-w-0">
|
||||
<p className="eyebrow flex items-center gap-1.5">
|
||||
<Users size={12} aria-hidden="true" /> {t('shared.badge')}
|
||||
</p>
|
||||
<h2 className="mt-1 text-2xl leading-tight">{list.name}</h2>
|
||||
<p className="mt-1 text-sm text-ink-3">
|
||||
{t('account.nTitles', { count: list.items.length })} · {t('shared.nMembers', { count: accepted.length })}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
{list.isOwner && !renaming && (
|
||||
<button onClick={() => setRenaming(true)} className="grid size-10 shrink-0 place-items-center rounded-full border border-line text-ink-2" aria-label={t('lists.rename')}>
|
||||
<Pencil size={16} />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Membres */}
|
||||
<section className="mt-5" aria-label={t('shared.members')}>
|
||||
<div className="mb-2 flex items-center justify-between">
|
||||
<span className="eyebrow">{t('shared.members')}</span>
|
||||
{list.isOwner && (
|
||||
<button onClick={() => social.openInvite(list.id, list.name)} className="chip py-1 text-xs">
|
||||
<UserPlus size={13} /> {t('shared.invite')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
<ul className="no-scrollbar -mx-4 flex gap-4 overflow-x-auto px-4 pb-1 lg:mx-0 lg:flex-wrap lg:px-0">
|
||||
{[...accepted, ...pending].map((m) => (
|
||||
<li key={m.id} className="relative w-16 shrink-0 text-center">
|
||||
<button onClick={() => social.openProfile(m.username)} className="block w-full" aria-label={m.displayName}>
|
||||
<Avatar url={m.avatarUrl} name={m.displayName} size={52} className={cx('mx-auto', m.status === 'pending' && 'opacity-50')} />
|
||||
<span className="mt-1.5 block truncate text-[11px] font-medium text-ink-2">{m.displayName}</span>
|
||||
<span className="block truncate text-[10px] text-ink-3">{m.isOwner ? t('shared.owner') : m.status === 'pending' ? t('shared.pending') : ' '}</span>
|
||||
</button>
|
||||
{list.isOwner && !m.isOwner && (
|
||||
<button
|
||||
onClick={() => void act(`m:${m.id}`, () => removeSharedListMember(list.id, m.id))}
|
||||
disabled={busyKey === `m:${m.id}`}
|
||||
className="absolute -top-1 end-0 grid size-6 place-items-center rounded-full border border-line-strong bg-surface text-ink-2"
|
||||
aria-label={t('shared.removeMember', { name: m.displayName })}
|
||||
>
|
||||
{busyKey === `m:${m.id}` ? <Loader2 size={11} className="animate-spin" /> : <X size={12} />}
|
||||
</button>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
{error && (
|
||||
<p role="alert" className="mt-3 text-sm text-accent">
|
||||
{error}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* Titres */}
|
||||
<div className="mt-6 flex flex-wrap items-center gap-2">
|
||||
<button onClick={() => setEditing((v) => !v)} className={cx('chip', editing && 'chip-on')}>
|
||||
{editing ? <Check size={14} /> : <Plus size={14} />}
|
||||
{editing ? t('lists.done') : t('lists.addRemove')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{editing && <LibraryPicker list={list} onChanged={refresh} />}
|
||||
|
||||
{list.items.length === 0 ? (
|
||||
<div className="mt-4">
|
||||
<EmptyState title={t('lists.emptyTitle')} text={t('shared.emptyText')} />
|
||||
</div>
|
||||
) : (
|
||||
<div className="mt-5 grid grid-cols-2 gap-x-3.5 gap-y-6 sm:grid-cols-3 lg:grid-cols-5 xl:grid-cols-6 2xl:grid-cols-8">
|
||||
{list.items.map((it) => (
|
||||
<SharedItemCard
|
||||
key={it.externalId}
|
||||
item={it}
|
||||
editing={editing}
|
||||
busy={busyKey === `i:${it.externalId}`}
|
||||
onOpen={() => social.openTitle(it)}
|
||||
onRemove={() => void act(`i:${it.externalId}`, () => removeSharedListItem(list.id, it.externalId))}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Quitter / supprimer */}
|
||||
<div className="mt-10 border-t border-line pt-5">
|
||||
{list.isOwner ? (
|
||||
<button onClick={() => setConfirm('delete')} className="flex items-center gap-2 text-sm font-medium text-accent">
|
||||
<Trash2 size={16} /> {t('shared.delete')}
|
||||
</button>
|
||||
) : (
|
||||
<button onClick={() => setConfirm('leave')} className="flex items-center gap-2 text-sm font-medium text-accent">
|
||||
<LogOut size={16} className="rtl:-scale-x-100" /> {t('shared.leave')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<ConfirmDialog
|
||||
open={confirm !== null}
|
||||
title={t('confirm.title')}
|
||||
message={list ? (confirm === 'delete' ? t('shared.deleteConfirm', { name: list.name }) : t('shared.leaveConfirm', { name: list.name })) : undefined}
|
||||
confirmLabel={confirm === 'delete' ? t('common.delete') : t('shared.leaveShort')}
|
||||
onCancel={() => setConfirm(null)}
|
||||
onConfirm={async () => {
|
||||
if (!list) return
|
||||
const kind = confirm
|
||||
setConfirm(null)
|
||||
try {
|
||||
if (kind === 'delete') await deleteSharedList(list.id)
|
||||
else await leaveSharedList(list.id)
|
||||
social.bumpShared()
|
||||
onClose()
|
||||
} catch (e) {
|
||||
setError((e as Error).message)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Sheet>
|
||||
)
|
||||
}
|
||||
|
||||
function SharedItemCard({ item, editing, busy, onOpen, onRemove }: { item: SharedListItem; editing: boolean; busy: boolean; onOpen: () => void; onRemove: () => void }) {
|
||||
return (
|
||||
<div className="relative">
|
||||
<button onClick={onOpen} className="block w-full text-start">
|
||||
<Poster src={item.poster} title={item.title} />
|
||||
<p className="mt-2 line-clamp-2 text-sm font-semibold leading-snug">{item.title}</p>
|
||||
<p className="mt-0.5 text-xs text-ink-3">{[item.year, TYPE_BY_VALUE[item.type].label].filter(Boolean).join(' · ')}</p>
|
||||
</button>
|
||||
{item.addedBy && (
|
||||
<p className="mt-1 flex items-center gap-1.5 text-[11px] text-ink-3">
|
||||
<Avatar url={item.addedBy.avatarUrl} name={item.addedBy.displayName} size={16} />
|
||||
<span className="truncate">{t('shared.addedBy', { name: item.addedBy.displayName })}</span>
|
||||
</p>
|
||||
)}
|
||||
{editing && (
|
||||
<button
|
||||
onClick={onRemove}
|
||||
disabled={busy}
|
||||
className="absolute end-1.5 top-1.5 grid size-8 place-items-center rounded-full border border-line-strong bg-bg/90 text-ink"
|
||||
aria-label={t('shared.removeTitle', { title: item.title })}
|
||||
>
|
||||
{busy ? <Loader2 size={14} className="animate-spin" /> : <X size={15} />}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** Ajouter / retirer des titres de ma bibliothèque (ceux qui ont une référence TMDB / AniList). */
|
||||
function LibraryPicker({ list, onChanged }: { list: SharedList; onChanged: () => void }) {
|
||||
const { items } = useMedia()
|
||||
const social = useSocial()
|
||||
const [query, setQuery] = useState('')
|
||||
const [busy, setBusy] = useState<string>()
|
||||
const [err, setErr] = useState<string>()
|
||||
const inList = useMemo(() => new Set(list.items.map((i) => i.externalId)), [list.items])
|
||||
|
||||
const candidates = useMemo(() => {
|
||||
const q = normalizeText(query)
|
||||
return items
|
||||
.filter((i) => i.externalId && (!q || normalizeText(`${i.title} ${i.originalTitle ?? ''}`).includes(q)))
|
||||
.sort((a, b) => a.title.localeCompare(b.title, locale()))
|
||||
.slice(0, 60)
|
||||
}, [items, query])
|
||||
|
||||
const toggle = async (item: (typeof items)[number]) => {
|
||||
const snap = snapshotOf(item)
|
||||
if (!snap) return
|
||||
setBusy(item.id)
|
||||
setErr(undefined)
|
||||
try {
|
||||
if (inList.has(snap.externalId)) await removeSharedListItem(list.id, snap.externalId)
|
||||
else await addSharedListItem(list.id, snap)
|
||||
onChanged()
|
||||
social.bumpShared()
|
||||
} catch (e) {
|
||||
setErr((e as Error).message)
|
||||
} finally {
|
||||
setBusy(undefined)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mt-4 rounded-2xl border border-line p-3">
|
||||
<div className="relative mb-2">
|
||||
<Search size={17} className="pointer-events-none absolute start-3.5 top-1/2 -translate-y-1/2 text-ink-3" />
|
||||
<input type="search" value={query} onChange={(e) => setQuery(e.target.value)} placeholder={t('lists.searchLibrary')} className="field ps-10" aria-label={t('lists.searchLibrary')} />
|
||||
</div>
|
||||
{err && (
|
||||
<p role="alert" className="mb-2 text-xs text-accent">
|
||||
{err}
|
||||
</p>
|
||||
)}
|
||||
<ul className="max-h-80 divide-y divide-line overflow-y-auto overscroll-contain">
|
||||
{candidates.map((item) => {
|
||||
const on = inList.has(item.externalId!)
|
||||
return (
|
||||
<li key={item.id}>
|
||||
<button onClick={() => void toggle(item)} disabled={busy === item.id} className="flex w-full items-center gap-3 py-2.5 text-start">
|
||||
<div className="w-9 shrink-0">
|
||||
<Poster src={item.poster} title={item.title} />
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="truncate text-sm font-medium">{item.title}</p>
|
||||
<div className="mt-1">
|
||||
<TypeBadge item={item} />
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
className={cx(
|
||||
'grid size-7 shrink-0 place-items-center rounded-full border',
|
||||
on ? 'border-accent-fill bg-accent-fill text-on-accent' : 'border-line-strong text-transparent',
|
||||
)}
|
||||
>
|
||||
{busy === item.id ? <Loader2 size={13} className="animate-spin text-ink-3" /> : <Check size={14} strokeWidth={3} />}
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
{candidates.length === 0 && <li className="py-4 text-center text-sm text-ink-3">{t('shared.noCandidates')}</li>}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// ════════════════════════ Inviter des membres ════════════════════════
|
||||
|
||||
export function InvitePeople({ listId, listName, onClose }: { listId: string; listName: string; onClose: () => void }) {
|
||||
const social = useSocial()
|
||||
const [q, setQ] = useState('')
|
||||
const [people, setPeople] = useState<ProfileCard[]>()
|
||||
const [invited, setInvited] = useState<Set<string>>(new Set())
|
||||
const [busy, setBusy] = useState<string>()
|
||||
const [err, setErr] = useState<string>()
|
||||
|
||||
useEffect(() => {
|
||||
let alive = true
|
||||
const timer = setTimeout(
|
||||
() => {
|
||||
inviteCandidates(listId, q)
|
||||
.then((r) => alive && setPeople(r))
|
||||
.catch((e) => alive && (setPeople([]), setErr((e as Error).message)))
|
||||
},
|
||||
q ? 250 : 0,
|
||||
)
|
||||
return () => {
|
||||
alive = false
|
||||
clearTimeout(timer)
|
||||
}
|
||||
}, [listId, q])
|
||||
|
||||
const invite = async (p: ProfileCard) => {
|
||||
setBusy(p.id)
|
||||
setErr(undefined)
|
||||
try {
|
||||
await inviteToSharedList(listId, p.id)
|
||||
setInvited((s) => new Set(s).add(p.id))
|
||||
social.bumpShared()
|
||||
} catch (e) {
|
||||
setErr((e as Error).message)
|
||||
} finally {
|
||||
setBusy(undefined)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Sheet title={t('shared.inviteTitle')} label={t('shared.inviteTitle')} onClose={onClose}>
|
||||
<div className="px-4 pt-4">
|
||||
<p className="text-sm text-ink-3">{t('shared.inviteHint', { name: listName })}</p>
|
||||
<div className="relative mt-3">
|
||||
<Search size={17} className="pointer-events-none absolute start-3.5 top-1/2 -translate-y-1/2 text-ink-3" />
|
||||
<input type="search" value={q} onChange={(e) => setQ(e.target.value)} placeholder={t('shared.searchPeople')} className="field ps-10" autoFocus aria-label={t('shared.searchPeople')} />
|
||||
</div>
|
||||
{err && (
|
||||
<p role="alert" className="mt-2 text-xs text-accent">
|
||||
{err}
|
||||
</p>
|
||||
)}
|
||||
{people === undefined ? (
|
||||
<p className="flex justify-center py-10 text-ink-3">
|
||||
<Loader2 size={18} className="animate-spin" />
|
||||
</p>
|
||||
) : people.length === 0 ? (
|
||||
<p className="py-10 text-center text-sm text-ink-3">{t('shared.noPeople')}</p>
|
||||
) : (
|
||||
<div className="mt-2 divide-y divide-line">
|
||||
{people.map((p) => (
|
||||
<PersonRow
|
||||
key={p.id}
|
||||
person={p}
|
||||
actions={
|
||||
<button
|
||||
onClick={() => void invite(p)}
|
||||
disabled={busy === p.id || invited.has(p.id)}
|
||||
className={cx(
|
||||
'flex h-8 shrink-0 items-center gap-1 rounded-full px-3 text-xs font-semibold transition active:scale-95',
|
||||
invited.has(p.id) ? 'border border-line-strong text-ink-2' : 'bg-accent-fill text-on-accent',
|
||||
)}
|
||||
>
|
||||
{busy === p.id ? <Loader2 size={13} className="animate-spin" /> : invited.has(p.id) ? <Check size={13} /> : <UserPlus size={13} />}
|
||||
{invited.has(p.id) ? t('shared.invited') : t('shared.inviteShort')}
|
||||
</button>
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Sheet>
|
||||
)
|
||||
}
|
||||
@@ -12,6 +12,11 @@ import TitleReviews from './TitleReviews'
|
||||
import Notifications from './Notifications'
|
||||
import { useOnResume } from '../../lib/onResume'
|
||||
import WelcomeProfile, { RANDOM_USERNAME } from './WelcomeProfile'
|
||||
import CommentsSheet from './CommentsSheet'
|
||||
import { InvitePeople, SharedListSheet } from './SharedLists'
|
||||
import { getAniListById, type SearchResult } from '../../lib/catalogApi'
|
||||
import { TYPE_BY_VALUE } from '../../lib/constants'
|
||||
import type { SharedListItem } from '../../lib/cloud/sharedLists'
|
||||
|
||||
interface SocialApi {
|
||||
/** Réseau disponible (compte connecté) */
|
||||
@@ -32,6 +37,17 @@ interface SocialApi {
|
||||
peek: (item: MediaItem, owner?: PeekOwner) => void
|
||||
/** Ouvre la fiche si elle est à moi, sinon l'aperçu */
|
||||
openItem: (item: MediaItem, owner?: PeekOwner) => void
|
||||
/** Fil de commentaires d'un avis, en plein écran (depuis une notification) */
|
||||
openComments: (authorId: string, itemId: string, title: string) => void
|
||||
/** Liste partagée */
|
||||
openSharedList: (id: string) => void
|
||||
/** Inviter des membres dans une liste partagée */
|
||||
openInvite: (listId: string, listName: string) => void
|
||||
/** Fiche d'un titre d'une liste partagée : la mienne si je l'ai, sinon la fiche du catalogue (ajout possible) */
|
||||
openTitle: (title: SharedListItem) => void
|
||||
/** Change à chaque modification des listes partagées (pour recharger les écrans qui les affichent) */
|
||||
sharedTick: number
|
||||
bumpShared: () => void
|
||||
}
|
||||
|
||||
const SocialContext = createContext<SocialApi>({
|
||||
@@ -48,6 +64,12 @@ const SocialContext = createContext<SocialApi>({
|
||||
unread: 0,
|
||||
peek: () => {},
|
||||
openItem: () => {},
|
||||
openComments: () => {},
|
||||
openSharedList: () => {},
|
||||
openInvite: () => {},
|
||||
openTitle: () => {},
|
||||
sharedTick: 0,
|
||||
bumpShared: () => {},
|
||||
})
|
||||
|
||||
export const useSocial = () => useContext(SocialContext)
|
||||
@@ -59,9 +81,21 @@ type Overlay =
|
||||
| { kind: 'follows'; profile: Profile; list: 'followers' | 'following' }
|
||||
| { kind: 'reviews'; externalId: string; title: string }
|
||||
| { kind: 'notifications' }
|
||||
| { kind: 'comments'; authorId: string; itemId: string; title: string }
|
||||
| { kind: 'sharedList'; id: string }
|
||||
| { kind: 'invite'; listId: string; listName: string }
|
||||
|
||||
/** Profils, recherche et aperçus : affichés par-dessus l'app, empilés (le bouton fermer revient au précédent). */
|
||||
export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNode; onOpenOwnItem: (item: MediaItem) => void }) {
|
||||
export function SocialProvider({
|
||||
children,
|
||||
onOpenOwnItem,
|
||||
onOpenSeed,
|
||||
}: {
|
||||
children: ReactNode
|
||||
onOpenOwnItem: (item: MediaItem) => void
|
||||
/** Ouvre la fiche d'un titre pas encore dans ma bibliothèque */
|
||||
onOpenSeed?: (seed: SearchResult) => void
|
||||
}) {
|
||||
const { account, items } = useMedia()
|
||||
const enabled = !!account
|
||||
const [me, setMe] = useState<Profile | null>(null)
|
||||
@@ -69,6 +103,8 @@ export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNod
|
||||
const [unread, setUnread] = useState(0)
|
||||
const [stack, setStack] = useState<Overlay[]>([])
|
||||
const [peeked, setPeeked] = useState<{ item: MediaItem; owner?: PeekOwner }>()
|
||||
const [sharedTick, setSharedTick] = useState(0)
|
||||
const bumpShared = useCallback(() => setSharedTick((n) => n + 1), [])
|
||||
// « Plus tard » sur le choix du pseudo : redemandé au prochain lancement
|
||||
const [welcomeLater, setWelcomeLater] = useState(() => {
|
||||
try {
|
||||
@@ -131,6 +167,30 @@ export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNod
|
||||
[items, me?.username, onOpenOwnItem],
|
||||
)
|
||||
|
||||
const openTitle = useCallback(
|
||||
async (s: SharedListItem) => {
|
||||
const local = items.find((i) => i.externalId === s.externalId)
|
||||
if (local) return onOpenOwnItem(local)
|
||||
const anilist = s.externalId.startsWith('anilist:')
|
||||
// AniList : fiche complète si possible (sinon l'instantané de la liste suffit pour l'ouvrir)
|
||||
const full = anilist && navigator.onLine ? await getAniListById(s.externalId).catch(() => null) : null
|
||||
onOpenSeed?.(
|
||||
full ?? {
|
||||
source: anilist ? 'anilist' : 'tmdb',
|
||||
externalId: s.externalId,
|
||||
title: s.title,
|
||||
year: s.year,
|
||||
thumb: s.poster,
|
||||
posterUrl: s.poster,
|
||||
kindLabel: TYPE_BY_VALUE[s.type].label,
|
||||
typeGuess: s.type,
|
||||
prefill: anilist ? { title: s.title, year: s.year, type: s.type, externalId: s.externalId, genres: [] } : undefined,
|
||||
},
|
||||
)
|
||||
},
|
||||
[items, onOpenOwnItem, onOpenSeed],
|
||||
)
|
||||
|
||||
const api = useMemo<SocialApi>(
|
||||
() => ({
|
||||
enabled,
|
||||
@@ -150,8 +210,14 @@ export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNod
|
||||
unread,
|
||||
peek: (item, owner) => setPeeked({ item, owner }),
|
||||
openItem,
|
||||
openComments: (authorId, itemId, title) => push({ kind: 'comments', authorId, itemId, title }),
|
||||
openSharedList: (id) => push({ kind: 'sharedList', id }),
|
||||
openInvite: (listId, listName) => push({ kind: 'invite', listId, listName }),
|
||||
openTitle: (s) => void openTitle(s),
|
||||
sharedTick,
|
||||
bumpShared,
|
||||
}),
|
||||
[enabled, me, requests, unread, refresh, push, openItem],
|
||||
[enabled, me, requests, unread, refresh, push, openItem, openTitle, sharedTick, bumpShared],
|
||||
)
|
||||
|
||||
return (
|
||||
@@ -169,6 +235,12 @@ export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNod
|
||||
<FollowList key={k} profile={o.profile} initial={o.list} onClose={pop} />
|
||||
) : o.kind === 'reviews' ? (
|
||||
<TitleReviews key={k} externalId={o.externalId} title={o.title} onClose={pop} onOpenProfile={(u) => push({ kind: 'profile', username: u })} />
|
||||
) : o.kind === 'comments' ? (
|
||||
<CommentsSheet key={k} authorId={o.authorId} itemId={o.itemId} title={o.title} onClose={pop} />
|
||||
) : o.kind === 'sharedList' ? (
|
||||
<SharedListSheet key={k} id={o.id} onClose={pop} />
|
||||
) : o.kind === 'invite' ? (
|
||||
<InvitePeople key={k} listId={o.listId} listName={o.listName} onClose={pop} />
|
||||
) : (
|
||||
<Notifications
|
||||
key={k}
|
||||
@@ -181,6 +253,15 @@ export function SocialProvider({ children, onOpenOwnItem }: { children: ReactNod
|
||||
onOpenOwnItem(it)
|
||||
}
|
||||
}}
|
||||
onOpenComments={(itemId, title) => {
|
||||
if (!me) return
|
||||
pop()
|
||||
push({ kind: 'comments', authorId: me.id, itemId, title })
|
||||
}}
|
||||
onOpenSharedList={(id) => {
|
||||
pop()
|
||||
push({ kind: 'sharedList', id })
|
||||
}}
|
||||
/>
|
||||
),
|
||||
)}
|
||||
|
||||
@@ -6,6 +6,8 @@ import { formatRating } from '../../lib/utils'
|
||||
import { useMedia } from '../../store'
|
||||
import Avatar from './Avatar'
|
||||
import Reactions from './Reactions'
|
||||
import ReviewComments from './ReviewComments'
|
||||
import ReviewText from './ReviewText'
|
||||
import Sheet from './Sheet'
|
||||
|
||||
/** Écran plein : tous les avis sur un même titre (amis / autres membres) avec réactions. */
|
||||
@@ -78,9 +80,11 @@ function ReviewCard({ r, onOpenProfile }: { r: TitleReview; onOpenProfile: (user
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{r.notes && <p className="mt-2 whitespace-pre-line text-sm leading-relaxed text-ink-2">{r.notes}</p>}
|
||||
{r.notes && <ReviewText text={r.notes} spoiler={r.spoiler} />}
|
||||
<div className="mt-3">
|
||||
<ReviewComments authorId={r.user_id} itemId={r.item_id} count={r.comments} hidden={r.comments === null}>
|
||||
<Reactions authorId={r.user_id} itemId={r.item_id} reactions={r.reactions} mine={r.mine} />
|
||||
</ReviewComments>
|
||||
</div>
|
||||
</article>
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { X } from 'lucide-react'
|
||||
import { EyeOff, X } from 'lucide-react'
|
||||
import { useState } from 'react'
|
||||
import { t } from '../../i18n'
|
||||
import { useBackToClose } from '../../lib/backNav'
|
||||
@@ -6,11 +6,24 @@ import { useEscape } from '../../lib/escape'
|
||||
import { LIMITS } from '../../lib/security'
|
||||
|
||||
/** Écriture de mon avis, en plein écran pour avoir la place d'écrire. */
|
||||
export default function ReviewEditor({ title, initial, onSave, onClose }: { title: string; initial: string; onSave: (notes: string) => void; onClose: () => void }) {
|
||||
export default function ReviewEditor({
|
||||
title,
|
||||
initial,
|
||||
initialSpoiler = false,
|
||||
onSave,
|
||||
onClose,
|
||||
}: {
|
||||
title: string
|
||||
initial: string
|
||||
initialSpoiler?: boolean
|
||||
onSave: (notes: string, spoiler: boolean) => void
|
||||
onClose: () => void
|
||||
}) {
|
||||
const [text, setText] = useState(initial)
|
||||
const [spoiler, setSpoiler] = useState(initialSpoiler)
|
||||
useEscape(onClose)
|
||||
useBackToClose(onClose)
|
||||
const changed = text.trim() !== initial.trim()
|
||||
const changed = text.trim() !== initial.trim() || (spoiler !== initialSpoiler && !!text.trim())
|
||||
return (
|
||||
<div className="sheet sheet-in z-[60]" role="dialog" aria-modal="true" aria-label={t('form.review')}>
|
||||
<header className="safe-top border-b border-line">
|
||||
@@ -19,7 +32,7 @@ export default function ReviewEditor({ title, initial, onSave, onClose }: { titl
|
||||
<X size={22} />
|
||||
</button>
|
||||
<h2 className="min-w-0 flex-1 truncate text-center text-base font-semibold">{title}</h2>
|
||||
<button onClick={() => onSave(text.trim())} disabled={!changed} className="btn btn-light px-4 py-2 text-sm">
|
||||
<button onClick={() => onSave(text.trim(), spoiler && !!text.trim())} disabled={!changed} className="btn btn-light px-4 py-2 text-sm">
|
||||
{t('common.save')}
|
||||
</button>
|
||||
</div>
|
||||
@@ -35,6 +48,15 @@ export default function ReviewEditor({ title, initial, onSave, onClose }: { titl
|
||||
maxLength={LIMITS.notes}
|
||||
autoFocus
|
||||
/>
|
||||
<label className="mt-3 flex cursor-pointer items-start gap-3 rounded-xl border border-line px-3.5 py-3">
|
||||
<input type="checkbox" checked={spoiler} onChange={(e) => setSpoiler(e.target.checked)} className="mt-0.5 size-4 shrink-0 accent-accent-fill" />
|
||||
<span className="min-w-0">
|
||||
<span className="flex items-center gap-1.5 text-sm font-medium text-ink">
|
||||
<EyeOff size={14} className="text-accent" aria-hidden="true" /> {t('spoiler.checkbox')}
|
||||
</span>
|
||||
<span className="mt-0.5 block text-xs text-ink-3">{t('spoiler.checkboxHint')}</span>
|
||||
</span>
|
||||
</label>
|
||||
<p className="mt-2 text-xs text-ink-3">{t('title.reviewPublicHint')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,8 @@ import { RatingInput } from '../Rating'
|
||||
import SharePreview from '../SharePreview'
|
||||
import EditDetails from './EditDetails'
|
||||
import ReviewEditor from './ReviewEditor'
|
||||
import ReviewComments from '../social/ReviewComments'
|
||||
import SharedListPicker from '../social/SharedListPicker'
|
||||
|
||||
/** Suivi « vide » d'un titre qu'on ajoute. */
|
||||
const BLANK: Pick<MediaInput, 'criteria' | 'episodesWatched' | 'genres'> = { criteria: {}, episodesWatched: 0, genres: [] }
|
||||
@@ -435,12 +437,23 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
{/* Mon avis */}
|
||||
<section className="mx-4 mt-4">
|
||||
{item?.notes ? (
|
||||
<button onClick={() => setReviewing(true)} className="card block w-full p-4 text-left">
|
||||
<div className="card p-4">
|
||||
<button onClick={() => setReviewing(true)} className="block w-full text-start">
|
||||
<span className="eyebrow flex items-center justify-between">
|
||||
{t('form.review')} <Pencil size={13} />
|
||||
<span className="flex items-center gap-2">
|
||||
{t('form.review')}
|
||||
{item.notesSpoiler && <span className="rounded-full border border-accent/50 px-1.5 py-px text-[10px] text-accent">{t('spoiler.badge')}</span>}
|
||||
</span>
|
||||
<Pencil size={13} />
|
||||
</span>
|
||||
<p className="mt-2 line-clamp-6 whitespace-pre-line text-sm leading-relaxed text-ink">{item.notes}</p>
|
||||
</button>
|
||||
{social.enabled && social.me && (
|
||||
<div className="mt-3 border-t border-line pt-3">
|
||||
<ReviewComments key={item.id} authorId={social.me.id} itemId={item.id} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<button onClick={() => setReviewing(true)} disabled={busy} className="flex w-full items-center gap-2 rounded-2xl border border-dashed border-line-strong px-4 py-3.5 text-left text-sm text-ink-2">
|
||||
<Pencil size={16} className="text-accent" /> {t('title.writeReview')}
|
||||
@@ -493,6 +506,11 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
|
||||
{/* Mon suivi : dates, plateforme, listes, revisionnages */}
|
||||
{item && <Tracking item={item} lists={lists} onChange={(patch) => void update(item.id, patch)} />}
|
||||
|
||||
{/* Listes partagées avec d'autres membres (titre de ma bibliothèque ou pas encore ajouté) */}
|
||||
{externalId && social.enabled && (
|
||||
<SharedListPicker snapshot={{ externalId, title, type, year: data.year, poster: item?.poster ?? poster }} posterFallback={seed?.posterUrl} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -522,11 +540,12 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
|
||||
<ReviewEditor
|
||||
title={title}
|
||||
initial={item?.notes ?? ''}
|
||||
initialSpoiler={!!item?.notesSpoiler}
|
||||
onClose={() => setReviewing(false)}
|
||||
onSave={async (notes) => {
|
||||
onSave={async (notes, spoiler) => {
|
||||
setReviewing(false)
|
||||
// Écrire un avis sur un titre pas encore ajouté le marque comme vu
|
||||
await save({ notes: notes || undefined, ...(item ? {} : { status: 'termine' as const, endDate: todayISO() }) })
|
||||
await save({ notes: notes || undefined, notesSpoiler: (notes && spoiler) || undefined, ...(item ? {} : { status: 'termine' as const, endDate: todayISO() }) })
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -1035,6 +1035,79 @@ const dict: Translations = {
|
||||
'sync.pending_two': "تعديلان في الانتظار",
|
||||
'sync.pending_few': "{count} تعديلات في الانتظار",
|
||||
'sync.pending_many': "{count} تعديلًا في الانتظار",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "يحتوي على حرق للأحداث",
|
||||
'spoiler.checkboxHint': "سيُخفى تقييمك عن الآخرين حتى يختاروا قراءته.",
|
||||
'spoiler.warning': "هذا التقييم يحرق الأحداث",
|
||||
'spoiler.show': "إظهار المحتوى",
|
||||
'spoiler.badge': "حرق أحداث",
|
||||
'comments.title': "التعليقات",
|
||||
'comments.none': "لا تعليقات بعد. ابدأ النقاش!",
|
||||
'comments.placeholder': "اكتب تعليقًا…",
|
||||
'comments.send': "إرسال",
|
||||
'comments.delete': "حذف التعليق",
|
||||
'comments.deleteConfirm': "حذف هذا التعليق؟",
|
||||
'comments.loadError': "تعذّر تحميل التعليقات.",
|
||||
'comments.unavailable': "التعليقات غير متاحة حاليًا.",
|
||||
'comments.err.rate': "تعلّق بسرعة كبيرة، حاول مجددًا بعد دقيقة.",
|
||||
'comments.err.gone': "لم يعد هذا التقييم متاحًا.",
|
||||
'comments.err.invalid': "التعليق فارغ أو طويل جدًا (500 حرف كحد أقصى).",
|
||||
'notif.review_comment': "علّق على تقييمك",
|
||||
'notif.shared_list_invite': "دعاك إلى القائمة المشتركة",
|
||||
'settings.notifComments': "التعليقات على تقييماتي",
|
||||
'settings.notifLists': "دعوات القوائم المشتركة",
|
||||
'shared.title': "القوائم المشتركة",
|
||||
'shared.hint': "قوائم جماعية: يمكن لكل عضو إضافة العناوين أو إزالتها.",
|
||||
'shared.new': "قائمة مشتركة جديدة",
|
||||
'shared.namePh': "اسم القائمة (مثلًا: أفلام نشاهدها معًا)",
|
||||
'shared.none': "لا قوائم مشتركة بعد. أنشئ واحدة وادعُ أصدقاءك.",
|
||||
'shared.invitesYou': "يدعوك للانضمام إلى",
|
||||
'shared.accept': "قبول",
|
||||
'shared.decline': "رفض",
|
||||
'shared.by': "بواسطة {name}",
|
||||
'shared.badge': "قائمة مشتركة",
|
||||
'shared.members': "الأعضاء",
|
||||
'shared.invite': "دعوة",
|
||||
'shared.owner': "المالك",
|
||||
'shared.pending': "بانتظار الرد",
|
||||
'shared.removeMember': "إزالة {name} من القائمة",
|
||||
'shared.removeTitle': "إزالة {title} من القائمة",
|
||||
'shared.addedBy': "أضافه {name}",
|
||||
'shared.emptyText': "أضف العناوين من صفحاتها أو من مكتبتك.",
|
||||
'shared.delete': "حذف القائمة المشتركة",
|
||||
'shared.deleteConfirm': "ستُحذف القائمة «{name}» لجميع أعضائها.",
|
||||
'shared.leave': "مغادرة القائمة",
|
||||
'shared.leaveShort': "مغادرة",
|
||||
'shared.leaveConfirm': "لن ترى القائمة «{name}» بعد الآن. يمكن لمالكها دعوتك من جديد.",
|
||||
'shared.notFound': "القائمة غير موجودة",
|
||||
'shared.noCandidates': "لا توجد عناوين في مكتبتك.",
|
||||
'shared.inviteTitle': "دعوة أعضاء",
|
||||
'shared.inviteHint': "ادعُ إلى «{name}» أشخاصًا تتابعهم أو يتابعونك.",
|
||||
'shared.searchPeople': "ابحث عن اسم مستخدم…",
|
||||
'shared.noPeople': "لا أحد لدعوته: يمكن فقط لمتابعيك ومن تتابعهم الانضمام.",
|
||||
'shared.inviteShort': "دعوة",
|
||||
'shared.invited': "تمت الدعوة",
|
||||
'shared.expired': "انتهت صلاحية الدعوة",
|
||||
'shared.addTo': "إضافة إلى قائمة مشتركة",
|
||||
'shared.unavailable': "القوائم المشتركة غير متاحة حاليًا.",
|
||||
'shared.err.rate': "إجراءات كثيرة متتالية، حاول مجددًا بعد دقيقة.",
|
||||
'shared.err.members': "بلغت هذه القائمة الحد الأقصى للأعضاء.",
|
||||
'shared.err.lists': "بلغت الحد الأقصى للقوائم المشتركة.",
|
||||
'shared.err.full': "هذه القائمة ممتلئة (500 عنوان).",
|
||||
'shared.err.notConnected': "يمكنك دعوة متابعيك ومن تتابعهم فقط.",
|
||||
'shared.err.forbidden': "غير مسموح: ليس لديك حق الوصول إلى هذه القائمة.",
|
||||
'comments.toggle_zero': "لا تعليقات",
|
||||
'comments.toggle_one': "تعليق واحد",
|
||||
'comments.toggle_two': "تعليقان",
|
||||
'comments.toggle_few': "{count} تعليقات",
|
||||
'comments.toggle_many': "{count} تعليقًا",
|
||||
'comments.toggle_other': "{count} تعليق",
|
||||
'shared.nMembers_zero': "لا أعضاء",
|
||||
'shared.nMembers_one': "عضو واحد",
|
||||
'shared.nMembers_two': "عضوان",
|
||||
'shared.nMembers_few': "{count} أعضاء",
|
||||
'shared.nMembers_many': "{count} عضوًا",
|
||||
'shared.nMembers_other': "{count} عضو",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} Änderung ausstehend",
|
||||
'sync.pending_other': "{count} Änderungen ausstehend",
|
||||
'sync.now': "Jetzt synchronisieren",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Enthält Spoiler",
|
||||
'spoiler.checkboxHint': "Deine Kritik wird für andere verborgen, bis sie sie bewusst lesen.",
|
||||
'spoiler.warning': "Diese Kritik enthält Spoiler",
|
||||
'spoiler.show': "Spoiler anzeigen",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Kommentare",
|
||||
'comments.none': "Noch keine Kommentare. Starte die Unterhaltung!",
|
||||
'comments.placeholder': "Kommentar schreiben…",
|
||||
'comments.send': "Senden",
|
||||
'comments.delete': "Kommentar löschen",
|
||||
'comments.deleteConfirm': "Diesen Kommentar löschen?",
|
||||
'comments.loadError': "Kommentare konnten nicht geladen werden.",
|
||||
'comments.unavailable': "Kommentare sind gerade nicht verfügbar.",
|
||||
'comments.err.rate': "Du kommentierst zu schnell – versuch es in einer Minute erneut.",
|
||||
'comments.err.gone': "Diese Kritik ist nicht mehr verfügbar.",
|
||||
'comments.err.invalid': "Kommentar leer oder zu lang (max. 500 Zeichen).",
|
||||
'notif.review_comment': "hat deine Kritik kommentiert",
|
||||
'notif.shared_list_invite': "hat dich in die geteilte Liste eingeladen",
|
||||
'settings.notifComments': "Kommentare zu meinen Kritiken",
|
||||
'settings.notifLists': "Einladungen zu geteilten Listen",
|
||||
'shared.title': "Geteilte Listen",
|
||||
'shared.hint': "Listen für mehrere: Jedes Mitglied kann Titel hinzufügen oder entfernen.",
|
||||
'shared.new': "Neue geteilte Liste",
|
||||
'shared.namePh': "Name der Liste (z. B. Filme für zu zweit)",
|
||||
'shared.none': "Noch keine geteilten Listen. Erstelle eine und lade Freunde ein.",
|
||||
'shared.invitesYou': "lädt dich ein zu",
|
||||
'shared.accept': "Annehmen",
|
||||
'shared.decline': "Ablehnen",
|
||||
'shared.by': "von {name}",
|
||||
'shared.badge': "Geteilte Liste",
|
||||
'shared.members': "Mitglieder",
|
||||
'shared.invite': "Einladen",
|
||||
'shared.owner': "Inhaber",
|
||||
'shared.pending': "Ausstehend",
|
||||
'shared.removeMember': "{name} aus der Liste entfernen",
|
||||
'shared.removeTitle': "{title} aus der Liste entfernen",
|
||||
'shared.addedBy': "Hinzugefügt von {name}",
|
||||
'shared.emptyText': "Füge Titel über ihre Seite oder aus deiner Bibliothek hinzu.",
|
||||
'shared.delete': "Geteilte Liste löschen",
|
||||
'shared.deleteConfirm': "Die Liste „{name}“ wird für alle Mitglieder gelöscht.",
|
||||
'shared.leave': "Liste verlassen",
|
||||
'shared.leaveShort': "Verlassen",
|
||||
'shared.leaveConfirm': "Du siehst die Liste „{name}“ nicht mehr. Der Inhaber kann dich erneut einladen.",
|
||||
'shared.notFound': "Liste nicht gefunden",
|
||||
'shared.noCandidates': "Keine Titel in deiner Bibliothek gefunden.",
|
||||
'shared.inviteTitle': "Mitglieder einladen",
|
||||
'shared.inviteHint': "Lade Personen, denen du folgst oder die dir folgen, in „{name}“ ein.",
|
||||
'shared.searchPeople': "Benutzernamen suchen…",
|
||||
'shared.noPeople': "Niemand zum Einladen: Nur deine Follower und Personen, denen du folgst, können beitreten.",
|
||||
'shared.inviteShort': "Einladen",
|
||||
'shared.invited': "Eingeladen",
|
||||
'shared.expired': "Einladung abgelaufen",
|
||||
'shared.addTo': "Zu einer geteilten Liste hinzufügen",
|
||||
'shared.unavailable': "Geteilte Listen sind gerade nicht verfügbar.",
|
||||
'shared.err.rate': "Zu viele Aktionen hintereinander – versuch es in einer Minute erneut.",
|
||||
'shared.err.members': "Diese Liste hat die maximale Mitgliederzahl erreicht.",
|
||||
'shared.err.lists': "Du hast die maximale Anzahl geteilter Listen erreicht.",
|
||||
'shared.err.full': "Diese Liste ist voll (500 Titel).",
|
||||
'shared.err.notConnected': "Du kannst nur deine Follower und Personen, denen du folgst, einladen.",
|
||||
'shared.err.forbidden': "Nicht erlaubt: Du hast keinen Zugriff auf diese Liste.",
|
||||
'comments.toggle_one': "{count} Kommentar",
|
||||
'comments.toggle_other': "{count} Kommentare",
|
||||
'shared.nMembers_one': "{count} Mitglied",
|
||||
'shared.nMembers_other': "{count} Mitglieder",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} change waiting",
|
||||
'sync.pending_other': "{count} changes waiting",
|
||||
'sync.now': "Sync now",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Contains spoilers",
|
||||
'spoiler.checkboxHint': "Your review will be hidden from others until they choose to read it.",
|
||||
'spoiler.warning': "This review contains spoilers",
|
||||
'spoiler.show': "Show spoiler",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Comments",
|
||||
'comments.none': "No comments yet. Start the conversation!",
|
||||
'comments.placeholder': "Write a comment…",
|
||||
'comments.send': "Send",
|
||||
'comments.delete': "Delete comment",
|
||||
'comments.deleteConfirm': "Delete this comment?",
|
||||
'comments.loadError': "Couldn’t load comments.",
|
||||
'comments.unavailable': "Comments are unavailable right now.",
|
||||
'comments.err.rate': "You’re commenting too fast — try again in a minute.",
|
||||
'comments.err.gone': "This review is no longer available.",
|
||||
'comments.err.invalid': "Comment is empty or too long (500 characters max).",
|
||||
'notif.review_comment': "commented on your review",
|
||||
'notif.shared_list_invite': "invited you to the shared list",
|
||||
'settings.notifComments': "Comments on my reviews",
|
||||
'settings.notifLists': "Shared list invitations",
|
||||
'shared.title': "Shared lists",
|
||||
'shared.hint': "Lists you build together: every member can add or remove titles.",
|
||||
'shared.new': "New shared list",
|
||||
'shared.namePh': "List name (e.g. Movies to watch together)",
|
||||
'shared.none': "No shared lists yet. Create one and invite your friends.",
|
||||
'shared.invitesYou': "invited you to join",
|
||||
'shared.accept': "Accept",
|
||||
'shared.decline': "Decline",
|
||||
'shared.by': "by {name}",
|
||||
'shared.badge': "Shared list",
|
||||
'shared.members': "Members",
|
||||
'shared.invite': "Invite",
|
||||
'shared.owner': "Owner",
|
||||
'shared.pending': "Pending",
|
||||
'shared.removeMember': "Remove {name} from the list",
|
||||
'shared.removeTitle': "Remove {title} from the list",
|
||||
'shared.addedBy': "Added by {name}",
|
||||
'shared.emptyText': "Add titles from their page or from your library.",
|
||||
'shared.delete': "Delete shared list",
|
||||
'shared.deleteConfirm': "The list “{name}” will be deleted for all its members.",
|
||||
'shared.leave': "Leave list",
|
||||
'shared.leaveShort': "Leave",
|
||||
'shared.leaveConfirm': "You will no longer see “{name}”. Its owner can invite you again.",
|
||||
'shared.notFound': "List not found",
|
||||
'shared.noCandidates': "No titles found in your library.",
|
||||
'shared.inviteTitle': "Invite members",
|
||||
'shared.inviteHint': "Invite people you follow or who follow you to “{name}”.",
|
||||
'shared.searchPeople': "Search a username…",
|
||||
'shared.noPeople': "Nobody to invite: only your followers and the people you follow can join the list.",
|
||||
'shared.inviteShort': "Invite",
|
||||
'shared.invited': "Invited",
|
||||
'shared.expired': "invitation expired",
|
||||
'shared.addTo': "Add to a shared list",
|
||||
'shared.unavailable': "Shared lists are unavailable right now.",
|
||||
'shared.err.rate': "Too many actions in a row — try again in a minute.",
|
||||
'shared.err.members': "This list has reached the maximum number of members.",
|
||||
'shared.err.lists': "You’ve reached the maximum number of shared lists.",
|
||||
'shared.err.full': "This list is full (500 titles).",
|
||||
'shared.err.notConnected': "You can only invite your followers and the people you follow.",
|
||||
'shared.err.forbidden': "Not allowed: you don’t have access to this list.",
|
||||
'comments.toggle_one': "{count} comment",
|
||||
'comments.toggle_other': "{count} comments",
|
||||
'shared.nMembers_one': "{count} member",
|
||||
'shared.nMembers_other': "{count} members",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} cambio pendiente",
|
||||
'sync.pending_other': "{count} cambios pendientes",
|
||||
'sync.now': "Sincronizar",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Contiene spoilers",
|
||||
'spoiler.checkboxHint': "Tu reseña quedará oculta para los demás hasta que decidan leerla.",
|
||||
'spoiler.warning': "Esta reseña contiene spoilers",
|
||||
'spoiler.show': "Mostrar spoiler",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Comentarios",
|
||||
'comments.none': "Aún no hay comentarios. ¡Empieza la conversación!",
|
||||
'comments.placeholder': "Escribe un comentario…",
|
||||
'comments.send': "Enviar",
|
||||
'comments.delete': "Eliminar comentario",
|
||||
'comments.deleteConfirm': "¿Eliminar este comentario?",
|
||||
'comments.loadError': "No se pudieron cargar los comentarios.",
|
||||
'comments.unavailable': "Los comentarios no están disponibles por ahora.",
|
||||
'comments.err.rate': "Comentas demasiado rápido: vuelve a intentarlo en un minuto.",
|
||||
'comments.err.gone': "Esta reseña ya no está disponible.",
|
||||
'comments.err.invalid': "Comentario vacío o demasiado largo (máx. 500 caracteres).",
|
||||
'notif.review_comment': "comentó tu reseña",
|
||||
'notif.shared_list_invite': "te invitó a la lista compartida",
|
||||
'settings.notifComments': "Comentarios en mis reseñas",
|
||||
'settings.notifLists': "Invitaciones a listas compartidas",
|
||||
'shared.title': "Listas compartidas",
|
||||
'shared.hint': "Listas entre varios: cada miembro puede añadir o quitar títulos.",
|
||||
'shared.new': "Nueva lista compartida",
|
||||
'shared.namePh': "Nombre de la lista (p. ej. Pelis para ver juntos)",
|
||||
'shared.none': "Aún no tienes listas compartidas. Crea una e invita a tus amigos.",
|
||||
'shared.invitesYou': "te invitó a unirte a",
|
||||
'shared.accept': "Aceptar",
|
||||
'shared.decline': "Rechazar",
|
||||
'shared.by': "de {name}",
|
||||
'shared.badge': "Lista compartida",
|
||||
'shared.members': "Miembros",
|
||||
'shared.invite': "Invitar",
|
||||
'shared.owner': "Propietario",
|
||||
'shared.pending': "Pendiente",
|
||||
'shared.removeMember': "Quitar a {name} de la lista",
|
||||
'shared.removeTitle': "Quitar {title} de la lista",
|
||||
'shared.addedBy': "Añadido por {name}",
|
||||
'shared.emptyText': "Añade títulos desde su ficha o desde tu biblioteca.",
|
||||
'shared.delete': "Eliminar la lista compartida",
|
||||
'shared.deleteConfirm': "La lista «{name}» se eliminará para todos sus miembros.",
|
||||
'shared.leave': "Salir de la lista",
|
||||
'shared.leaveShort': "Salir",
|
||||
'shared.leaveConfirm': "Dejarás de ver la lista «{name}». Su propietario podrá volver a invitarte.",
|
||||
'shared.notFound': "Lista no encontrada",
|
||||
'shared.noCandidates': "No se encontraron títulos en tu biblioteca.",
|
||||
'shared.inviteTitle': "Invitar miembros",
|
||||
'shared.inviteHint': "Invita a «{name}» a personas que sigues o que te siguen.",
|
||||
'shared.searchPeople': "Buscar un usuario…",
|
||||
'shared.noPeople': "Nadie a quien invitar: solo tus seguidores y las personas que sigues pueden unirse.",
|
||||
'shared.inviteShort': "Invitar",
|
||||
'shared.invited': "Invitado",
|
||||
'shared.expired': "invitación caducada",
|
||||
'shared.addTo': "Añadir a una lista compartida",
|
||||
'shared.unavailable': "Las listas compartidas no están disponibles por ahora.",
|
||||
'shared.err.rate': "Demasiadas acciones seguidas: vuelve a intentarlo en un minuto.",
|
||||
'shared.err.members': "Esta lista alcanzó el número máximo de miembros.",
|
||||
'shared.err.lists': "Alcanzaste el número máximo de listas compartidas.",
|
||||
'shared.err.full': "Esta lista está llena (500 títulos).",
|
||||
'shared.err.notConnected': "Solo puedes invitar a tus seguidores y a las personas que sigues.",
|
||||
'shared.err.forbidden': "Acción no permitida: no tienes acceso a esta lista.",
|
||||
'comments.toggle_one': "{count} comentario",
|
||||
'comments.toggle_other': "{count} comentarios",
|
||||
'shared.nMembers_one': "{count} miembro",
|
||||
'shared.nMembers_other': "{count} miembros",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -899,6 +899,71 @@ const dict = {
|
||||
'sync.pending_one': "{count} modification en attente",
|
||||
'sync.pending_other': "{count} modifications en attente",
|
||||
'sync.now': "Synchroniser",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Contient des spoilers",
|
||||
'spoiler.checkboxHint': "Ton avis sera masqué chez les autres jusqu’à ce qu’ils choisissent de le lire.",
|
||||
'spoiler.warning': "Cet avis contient des spoilers",
|
||||
'spoiler.show': "Afficher le spoiler",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Commentaires",
|
||||
'comments.none': "Pas encore de commentaire. Lance la discussion !",
|
||||
'comments.placeholder': "Écrire un commentaire…",
|
||||
'comments.send': "Envoyer",
|
||||
'comments.delete': "Supprimer le commentaire",
|
||||
'comments.deleteConfirm': "Supprimer ce commentaire ?",
|
||||
'comments.loadError': "Impossible de charger les commentaires.",
|
||||
'comments.unavailable': "Commentaires indisponibles pour le moment.",
|
||||
'comments.err.rate': "Tu commentes trop vite : réessaie dans une minute.",
|
||||
'comments.err.gone': "Cet avis n’est plus disponible.",
|
||||
'comments.err.invalid': "Commentaire vide ou trop long (500 caractères max).",
|
||||
'notif.review_comment': "a commenté ton avis",
|
||||
'notif.shared_list_invite': "t’invite dans la liste partagée",
|
||||
'settings.notifComments': "Commentaires sur mes avis",
|
||||
'settings.notifLists': "Invitations aux listes partagées",
|
||||
'shared.title': "Listes partagées",
|
||||
'shared.hint': "Des listes à plusieurs : chaque membre ajoute ou retire des titres.",
|
||||
'shared.new': "Nouvelle liste partagée",
|
||||
'shared.namePh': "Nom de la liste (ex. Films à voir à deux)",
|
||||
'shared.none': "Aucune liste partagée. Crées-en une et invite tes amis.",
|
||||
'shared.invitesYou': "t’invite à rejoindre",
|
||||
'shared.accept': "Accepter",
|
||||
'shared.decline': "Refuser",
|
||||
'shared.by': "par {name}",
|
||||
'shared.badge': "Liste partagée",
|
||||
'shared.members': "Membres",
|
||||
'shared.invite': "Inviter",
|
||||
'shared.owner': "Propriétaire",
|
||||
'shared.pending': "En attente",
|
||||
'shared.removeMember': "Retirer {name} de la liste",
|
||||
'shared.removeTitle': "Retirer {title} de la liste",
|
||||
'shared.addedBy': "Ajouté par {name}",
|
||||
'shared.emptyText': "Ajoute des titres depuis leur fiche ou depuis ta bibliothèque.",
|
||||
'shared.delete': "Supprimer la liste partagée",
|
||||
'shared.deleteConfirm': "La liste « {name} » sera supprimée pour tous ses membres.",
|
||||
'shared.leave': "Quitter la liste",
|
||||
'shared.leaveShort': "Quitter",
|
||||
'shared.leaveConfirm': "Tu ne verras plus la liste « {name} ». Son propriétaire pourra te réinviter.",
|
||||
'shared.notFound': "Liste introuvable",
|
||||
'shared.noCandidates': "Aucun titre trouvé dans ta bibliothèque.",
|
||||
'shared.inviteTitle': "Inviter des membres",
|
||||
'shared.inviteHint': "Invite des personnes que tu suis ou qui te suivent dans « {name} ».",
|
||||
'shared.searchPeople': "Chercher un pseudo…",
|
||||
'shared.noPeople': "Personne à inviter : seuls tes abonnés et tes abonnements peuvent rejoindre la liste.",
|
||||
'shared.inviteShort': "Inviter",
|
||||
'shared.invited': "Invité",
|
||||
'shared.expired': "invitation expirée",
|
||||
'shared.addTo': "Ajouter à une liste partagée",
|
||||
'shared.unavailable': "Listes partagées indisponibles pour le moment.",
|
||||
'shared.err.rate': "Trop d’actions d’affilée : réessaie dans une minute.",
|
||||
'shared.err.members': "Cette liste a atteint le nombre maximum de membres.",
|
||||
'shared.err.lists': "Tu as atteint le nombre maximum de listes partagées.",
|
||||
'shared.err.full': "Cette liste est pleine (500 titres).",
|
||||
'shared.err.notConnected': "Tu ne peux inviter que tes abonnés et tes abonnements.",
|
||||
'shared.err.forbidden': "Action impossible : tu n’as pas accès à cette liste.",
|
||||
'comments.toggle_one': "{count} commentaire",
|
||||
'comments.toggle_other': "{count} commentaires",
|
||||
'shared.nMembers_one': "{count} membre",
|
||||
'shared.nMembers_other': "{count} membres",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} बदलाव बाकी",
|
||||
'sync.pending_other': "{count} बदलाव बाकी",
|
||||
'sync.now': "अभी सिंक करें",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "इसमें स्पॉइलर हैं",
|
||||
'spoiler.checkboxHint': "आपका रिव्यू दूसरों से तब तक छिपा रहेगा जब तक वे उसे पढ़ना न चुनें।",
|
||||
'spoiler.warning': "इस रिव्यू में स्पॉइलर हैं",
|
||||
'spoiler.show': "स्पॉइलर दिखाएँ",
|
||||
'spoiler.badge': "स्पॉइलर",
|
||||
'comments.title': "टिप्पणियाँ",
|
||||
'comments.none': "अभी कोई टिप्पणी नहीं। बातचीत शुरू करें!",
|
||||
'comments.placeholder': "टिप्पणी लिखें…",
|
||||
'comments.send': "भेजें",
|
||||
'comments.delete': "टिप्पणी हटाएँ",
|
||||
'comments.deleteConfirm': "यह टिप्पणी हटाएँ?",
|
||||
'comments.loadError': "टिप्पणियाँ लोड नहीं हो सकीं।",
|
||||
'comments.unavailable': "टिप्पणियाँ अभी उपलब्ध नहीं हैं।",
|
||||
'comments.err.rate': "आप बहुत तेज़ी से टिप्पणी कर रहे हैं — एक मिनट बाद फिर कोशिश करें।",
|
||||
'comments.err.gone': "यह रिव्यू अब उपलब्ध नहीं है।",
|
||||
'comments.err.invalid': "टिप्पणी खाली है या बहुत लंबी है (अधिकतम 500 अक्षर)।",
|
||||
'notif.review_comment': "ने आपके रिव्यू पर टिप्पणी की",
|
||||
'notif.shared_list_invite': "ने आपको साझा सूची में आमंत्रित किया",
|
||||
'settings.notifComments': "मेरे रिव्यू पर टिप्पणियाँ",
|
||||
'settings.notifLists': "साझा सूचियों के आमंत्रण",
|
||||
'shared.title': "साझा सूचियाँ",
|
||||
'shared.hint': "मिलकर बनाई गई सूचियाँ: हर सदस्य टाइटल जोड़ या हटा सकता है।",
|
||||
'shared.new': "नई साझा सूची",
|
||||
'shared.namePh': "सूची का नाम (जैसे साथ में देखने वाली फ़िल्में)",
|
||||
'shared.none': "अभी कोई साझा सूची नहीं। एक बनाएँ और दोस्तों को आमंत्रित करें।",
|
||||
'shared.invitesYou': "ने आपको इसमें शामिल होने का न्योता दिया:",
|
||||
'shared.accept': "स्वीकार करें",
|
||||
'shared.decline': "अस्वीकार करें",
|
||||
'shared.by': "{name} द्वारा",
|
||||
'shared.badge': "साझा सूची",
|
||||
'shared.members': "सदस्य",
|
||||
'shared.invite': "आमंत्रित करें",
|
||||
'shared.owner': "मालिक",
|
||||
'shared.pending': "प्रतीक्षा में",
|
||||
'shared.removeMember': "{name} को सूची से हटाएँ",
|
||||
'shared.removeTitle': "{title} को सूची से हटाएँ",
|
||||
'shared.addedBy': "{name} ने जोड़ा",
|
||||
'shared.emptyText': "टाइटल उनके पेज से या अपनी लाइब्रेरी से जोड़ें।",
|
||||
'shared.delete': "साझा सूची हटाएँ",
|
||||
'shared.deleteConfirm': "सूची “{name}” सभी सदस्यों के लिए हटा दी जाएगी।",
|
||||
'shared.leave': "सूची छोड़ें",
|
||||
'shared.leaveShort': "छोड़ें",
|
||||
'shared.leaveConfirm': "अब आपको सूची “{name}” नहीं दिखेगी। इसका मालिक आपको फिर से आमंत्रित कर सकता है।",
|
||||
'shared.notFound': "सूची नहीं मिली",
|
||||
'shared.noCandidates': "आपकी लाइब्रेरी में कोई टाइटल नहीं मिला।",
|
||||
'shared.inviteTitle': "सदस्य आमंत्रित करें",
|
||||
'shared.inviteHint': "“{name}” में उन लोगों को आमंत्रित करें जिन्हें आप फ़ॉलो करते हैं या जो आपको फ़ॉलो करते हैं।",
|
||||
'shared.searchPeople': "यूज़रनेम खोजें…",
|
||||
'shared.noPeople': "आमंत्रित करने के लिए कोई नहीं: केवल आपके फ़ॉलोअर्स और जिन्हें आप फ़ॉलो करते हैं, वही जुड़ सकते हैं।",
|
||||
'shared.inviteShort': "आमंत्रित करें",
|
||||
'shared.invited': "आमंत्रित",
|
||||
'shared.expired': "आमंत्रण की अवधि समाप्त",
|
||||
'shared.addTo': "साझा सूची में जोड़ें",
|
||||
'shared.unavailable': "साझा सूचियाँ अभी उपलब्ध नहीं हैं।",
|
||||
'shared.err.rate': "लगातार बहुत सारी कार्रवाइयाँ — एक मिनट बाद फिर कोशिश करें।",
|
||||
'shared.err.members': "इस सूची में सदस्यों की अधिकतम संख्या पूरी हो गई है।",
|
||||
'shared.err.lists': "आप साझा सूचियों की अधिकतम संख्या तक पहुँच गए हैं।",
|
||||
'shared.err.full': "यह सूची भर गई है (500 टाइटल)।",
|
||||
'shared.err.notConnected': "आप केवल अपने फ़ॉलोअर्स और जिन्हें आप फ़ॉलो करते हैं, उन्हें ही आमंत्रित कर सकते हैं।",
|
||||
'shared.err.forbidden': "अनुमति नहीं: इस सूची तक आपकी पहुँच नहीं है।",
|
||||
'comments.toggle_one': "{count} टिप्पणी",
|
||||
'comments.toggle_other': "{count} टिप्पणियाँ",
|
||||
'shared.nMembers_one': "{count} सदस्य",
|
||||
'shared.nMembers_other': "{count} सदस्य",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} perubahan menunggu",
|
||||
'sync.pending_other': "{count} perubahan menunggu",
|
||||
'sync.now': "Sinkronkan",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Mengandung spoiler",
|
||||
'spoiler.checkboxHint': "Ulasanmu akan disembunyikan dari orang lain sampai mereka memilih untuk membacanya.",
|
||||
'spoiler.warning': "Ulasan ini mengandung spoiler",
|
||||
'spoiler.show': "Tampilkan spoiler",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Komentar",
|
||||
'comments.none': "Belum ada komentar. Mulai percakapan!",
|
||||
'comments.placeholder': "Tulis komentar…",
|
||||
'comments.send': "Kirim",
|
||||
'comments.delete': "Hapus komentar",
|
||||
'comments.deleteConfirm': "Hapus komentar ini?",
|
||||
'comments.loadError': "Gagal memuat komentar.",
|
||||
'comments.unavailable': "Komentar sedang tidak tersedia.",
|
||||
'comments.err.rate': "Kamu berkomentar terlalu cepat — coba lagi dalam satu menit.",
|
||||
'comments.err.gone': "Ulasan ini sudah tidak tersedia.",
|
||||
'comments.err.invalid': "Komentar kosong atau terlalu panjang (maks. 500 karakter).",
|
||||
'notif.review_comment': "mengomentari ulasanmu",
|
||||
'notif.shared_list_invite': "mengundangmu ke daftar bersama",
|
||||
'settings.notifComments': "Komentar di ulasanku",
|
||||
'settings.notifLists': "Undangan daftar bersama",
|
||||
'shared.title': "Daftar bersama",
|
||||
'shared.hint': "Daftar yang dibuat bersama: setiap anggota bisa menambah atau menghapus judul.",
|
||||
'shared.new': "Daftar bersama baru",
|
||||
'shared.namePh': "Nama daftar (mis. Film untuk ditonton berdua)",
|
||||
'shared.none': "Belum ada daftar bersama. Buat satu dan undang temanmu.",
|
||||
'shared.invitesYou': "mengundangmu bergabung ke",
|
||||
'shared.accept': "Terima",
|
||||
'shared.decline': "Tolak",
|
||||
'shared.by': "oleh {name}",
|
||||
'shared.badge': "Daftar bersama",
|
||||
'shared.members': "Anggota",
|
||||
'shared.invite': "Undang",
|
||||
'shared.owner': "Pemilik",
|
||||
'shared.pending': "Menunggu",
|
||||
'shared.removeMember': "Keluarkan {name} dari daftar",
|
||||
'shared.removeTitle': "Hapus {title} dari daftar",
|
||||
'shared.addedBy': "Ditambahkan oleh {name}",
|
||||
'shared.emptyText': "Tambahkan judul dari halamannya atau dari pustakamu.",
|
||||
'shared.delete': "Hapus daftar bersama",
|
||||
'shared.deleteConfirm': "Daftar “{name}” akan dihapus untuk semua anggotanya.",
|
||||
'shared.leave': "Keluar dari daftar",
|
||||
'shared.leaveShort': "Keluar",
|
||||
'shared.leaveConfirm': "Kamu tidak akan melihat daftar “{name}” lagi. Pemiliknya bisa mengundangmu kembali.",
|
||||
'shared.notFound': "Daftar tidak ditemukan",
|
||||
'shared.noCandidates': "Tidak ada judul di pustakamu.",
|
||||
'shared.inviteTitle': "Undang anggota",
|
||||
'shared.inviteHint': "Undang orang yang kamu ikuti atau yang mengikutimu ke “{name}”.",
|
||||
'shared.searchPeople': "Cari nama pengguna…",
|
||||
'shared.noPeople': "Tidak ada yang bisa diundang: hanya pengikut dan yang kamu ikuti yang bisa bergabung.",
|
||||
'shared.inviteShort': "Undang",
|
||||
'shared.invited': "Diundang",
|
||||
'shared.expired': "undangan kedaluwarsa",
|
||||
'shared.addTo': "Tambahkan ke daftar bersama",
|
||||
'shared.unavailable': "Daftar bersama sedang tidak tersedia.",
|
||||
'shared.err.rate': "Terlalu banyak tindakan berturut-turut — coba lagi dalam satu menit.",
|
||||
'shared.err.members': "Daftar ini sudah mencapai jumlah anggota maksimum.",
|
||||
'shared.err.lists': "Kamu sudah mencapai jumlah maksimum daftar bersama.",
|
||||
'shared.err.full': "Daftar ini penuh (500 judul).",
|
||||
'shared.err.notConnected': "Kamu hanya bisa mengundang pengikut dan orang yang kamu ikuti.",
|
||||
'shared.err.forbidden': "Tidak diizinkan: kamu tidak punya akses ke daftar ini.",
|
||||
'comments.toggle_one': "{count} komentar",
|
||||
'comments.toggle_other': "{count} komentar",
|
||||
'shared.nMembers_one': "{count} anggota",
|
||||
'shared.nMembers_other': "{count} anggota",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} modifica in attesa",
|
||||
'sync.pending_other': "{count} modifiche in attesa",
|
||||
'sync.now': "Sincronizza",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Contiene spoiler",
|
||||
'spoiler.checkboxHint': "La tua recensione sarà nascosta agli altri finché non sceglieranno di leggerla.",
|
||||
'spoiler.warning': "Questa recensione contiene spoiler",
|
||||
'spoiler.show': "Mostra spoiler",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Commenti",
|
||||
'comments.none': "Ancora nessun commento. Inizia tu la conversazione!",
|
||||
'comments.placeholder': "Scrivi un commento…",
|
||||
'comments.send': "Invia",
|
||||
'comments.delete': "Elimina commento",
|
||||
'comments.deleteConfirm': "Eliminare questo commento?",
|
||||
'comments.loadError': "Impossibile caricare i commenti.",
|
||||
'comments.unavailable': "Commenti non disponibili al momento.",
|
||||
'comments.err.rate': "Stai commentando troppo in fretta: riprova tra un minuto.",
|
||||
'comments.err.gone': "Questa recensione non è più disponibile.",
|
||||
'comments.err.invalid': "Commento vuoto o troppo lungo (max 500 caratteri).",
|
||||
'notif.review_comment': "ha commentato la tua recensione",
|
||||
'notif.shared_list_invite': "ti ha invitato nella lista condivisa",
|
||||
'settings.notifComments': "Commenti alle mie recensioni",
|
||||
'settings.notifLists': "Inviti alle liste condivise",
|
||||
'shared.title': "Liste condivise",
|
||||
'shared.hint': "Liste a più mani: ogni membro può aggiungere o togliere titoli.",
|
||||
'shared.new': "Nuova lista condivisa",
|
||||
'shared.namePh': "Nome della lista (es. Film da vedere insieme)",
|
||||
'shared.none': "Nessuna lista condivisa. Creane una e invita i tuoi amici.",
|
||||
'shared.invitesYou': "ti ha invitato a unirti a",
|
||||
'shared.accept': "Accetta",
|
||||
'shared.decline': "Rifiuta",
|
||||
'shared.by': "di {name}",
|
||||
'shared.badge': "Lista condivisa",
|
||||
'shared.members': "Membri",
|
||||
'shared.invite': "Invita",
|
||||
'shared.owner': "Proprietario",
|
||||
'shared.pending': "In attesa",
|
||||
'shared.removeMember': "Rimuovi {name} dalla lista",
|
||||
'shared.removeTitle': "Rimuovi {title} dalla lista",
|
||||
'shared.addedBy': "Aggiunto da {name}",
|
||||
'shared.emptyText': "Aggiungi titoli dalla loro scheda o dalla tua libreria.",
|
||||
'shared.delete': "Elimina la lista condivisa",
|
||||
'shared.deleteConfirm': "La lista «{name}» verrà eliminata per tutti i membri.",
|
||||
'shared.leave': "Lascia la lista",
|
||||
'shared.leaveShort': "Lascia",
|
||||
'shared.leaveConfirm': "Non vedrai più la lista «{name}». Il proprietario potrà invitarti di nuovo.",
|
||||
'shared.notFound': "Lista non trovata",
|
||||
'shared.noCandidates': "Nessun titolo trovato nella tua libreria.",
|
||||
'shared.inviteTitle': "Invita membri",
|
||||
'shared.inviteHint': "Invita in «{name}» persone che segui o che ti seguono.",
|
||||
'shared.searchPeople': "Cerca un nome utente…",
|
||||
'shared.noPeople': "Nessuno da invitare: solo i tuoi follower e le persone che segui possono unirsi.",
|
||||
'shared.inviteShort': "Invita",
|
||||
'shared.invited': "Invitato",
|
||||
'shared.expired': "invito scaduto",
|
||||
'shared.addTo': "Aggiungi a una lista condivisa",
|
||||
'shared.unavailable': "Liste condivise non disponibili al momento.",
|
||||
'shared.err.rate': "Troppe azioni di fila: riprova tra un minuto.",
|
||||
'shared.err.members': "Questa lista ha raggiunto il numero massimo di membri.",
|
||||
'shared.err.lists': "Hai raggiunto il numero massimo di liste condivise.",
|
||||
'shared.err.full': "Questa lista è piena (500 titoli).",
|
||||
'shared.err.notConnected': "Puoi invitare solo i tuoi follower e le persone che segui.",
|
||||
'shared.err.forbidden': "Azione non consentita: non hai accesso a questa lista.",
|
||||
'comments.toggle_one': "{count} commento",
|
||||
'comments.toggle_other': "{count} commenti",
|
||||
'shared.nMembers_one': "{count} membro",
|
||||
'shared.nMembers_other': "{count} membri",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} 件の変更が保留中",
|
||||
'sync.pending_other': "{count} 件の変更が保留中",
|
||||
'sync.now': "今すぐ同期",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "ネタバレを含む",
|
||||
'spoiler.checkboxHint': "あなたのレビューは、他の人が読むことを選ぶまで非表示になります。",
|
||||
'spoiler.warning': "このレビューにはネタバレが含まれます",
|
||||
'spoiler.show': "ネタバレを表示",
|
||||
'spoiler.badge': "ネタバレ",
|
||||
'comments.title': "コメント",
|
||||
'comments.none': "まだコメントはありません。話しかけてみましょう!",
|
||||
'comments.placeholder': "コメントを書く…",
|
||||
'comments.send': "送信",
|
||||
'comments.delete': "コメントを削除",
|
||||
'comments.deleteConfirm': "このコメントを削除しますか?",
|
||||
'comments.loadError': "コメントを読み込めませんでした。",
|
||||
'comments.unavailable': "コメントは現在利用できません。",
|
||||
'comments.err.rate': "コメントの投稿が速すぎます。1分後にもう一度お試しください。",
|
||||
'comments.err.gone': "このレビューはもう利用できません。",
|
||||
'comments.err.invalid': "コメントが空か長すぎます(最大500文字)。",
|
||||
'notif.review_comment': "があなたのレビューにコメントしました",
|
||||
'notif.shared_list_invite': "があなたを共有リストに招待しました",
|
||||
'settings.notifComments': "自分のレビューへのコメント",
|
||||
'settings.notifLists': "共有リストへの招待",
|
||||
'shared.title': "共有リスト",
|
||||
'shared.hint': "みんなで作るリスト:メンバー全員が作品を追加・削除できます。",
|
||||
'shared.new': "新しい共有リスト",
|
||||
'shared.namePh': "リスト名(例:一緒に観たい映画)",
|
||||
'shared.none': "共有リストはまだありません。作成して友達を招待しましょう。",
|
||||
'shared.invitesYou': "から招待が届いています:",
|
||||
'shared.accept': "承認",
|
||||
'shared.decline': "辞退",
|
||||
'shared.by': "{name} のリスト",
|
||||
'shared.badge': "共有リスト",
|
||||
'shared.members': "メンバー",
|
||||
'shared.invite': "招待",
|
||||
'shared.owner': "オーナー",
|
||||
'shared.pending': "招待中",
|
||||
'shared.removeMember': "{name} をリストから外す",
|
||||
'shared.removeTitle': "「{title}」をリストから外す",
|
||||
'shared.addedBy': "{name} が追加",
|
||||
'shared.emptyText': "作品ページやライブラリから作品を追加できます。",
|
||||
'shared.delete': "共有リストを削除",
|
||||
'shared.deleteConfirm': "リスト「{name}」はすべてのメンバーから削除されます。",
|
||||
'shared.leave': "リストから抜ける",
|
||||
'shared.leaveShort': "抜ける",
|
||||
'shared.leaveConfirm': "リスト「{name}」は表示されなくなります。オーナーは再度招待できます。",
|
||||
'shared.notFound': "リストが見つかりません",
|
||||
'shared.noCandidates': "ライブラリに作品が見つかりません。",
|
||||
'shared.inviteTitle': "メンバーを招待",
|
||||
'shared.inviteHint': "フォローしている人やフォロワーを「{name}」に招待しましょう。",
|
||||
'shared.searchPeople': "ユーザー名を検索…",
|
||||
'shared.noPeople': "招待できる人がいません:参加できるのはフォロワーとフォロー中の人だけです。",
|
||||
'shared.inviteShort': "招待",
|
||||
'shared.invited': "招待済み",
|
||||
'shared.expired': "招待の期限切れ",
|
||||
'shared.addTo': "共有リストに追加",
|
||||
'shared.unavailable': "共有リストは現在利用できません。",
|
||||
'shared.err.rate': "操作が続きすぎています。1分後にもう一度お試しください。",
|
||||
'shared.err.members': "このリストのメンバー数が上限に達しました。",
|
||||
'shared.err.lists': "共有リストの数が上限に達しました。",
|
||||
'shared.err.full': "このリストは満杯です(500作品)。",
|
||||
'shared.err.notConnected': "招待できるのはフォロワーとフォロー中の人だけです。",
|
||||
'shared.err.forbidden': "操作できません:このリストへのアクセス権がありません。",
|
||||
'comments.toggle_one': "コメント{count}件",
|
||||
'comments.toggle_other': "コメント{count}件",
|
||||
'shared.nMembers_one': "メンバー{count}人",
|
||||
'shared.nMembers_other': "メンバー{count}人",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "변경 {count}개 대기 중",
|
||||
'sync.pending_other': "변경 {count}개 대기 중",
|
||||
'sync.now': "지금 동기화",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "스포일러 포함",
|
||||
'spoiler.checkboxHint': "다른 사람이 직접 읽기로 선택할 때까지 리뷰가 가려집니다.",
|
||||
'spoiler.warning': "이 리뷰에는 스포일러가 있습니다",
|
||||
'spoiler.show': "스포일러 보기",
|
||||
'spoiler.badge': "스포일러",
|
||||
'comments.title': "댓글",
|
||||
'comments.none': "아직 댓글이 없어요. 대화를 시작해 보세요!",
|
||||
'comments.placeholder': "댓글 쓰기…",
|
||||
'comments.send': "보내기",
|
||||
'comments.delete': "댓글 삭제",
|
||||
'comments.deleteConfirm': "이 댓글을 삭제할까요?",
|
||||
'comments.loadError': "댓글을 불러오지 못했습니다.",
|
||||
'comments.unavailable': "지금은 댓글을 사용할 수 없습니다.",
|
||||
'comments.err.rate': "댓글을 너무 빨리 달고 있어요. 1분 후 다시 시도하세요.",
|
||||
'comments.err.gone': "이 리뷰는 더 이상 볼 수 없습니다.",
|
||||
'comments.err.invalid': "댓글이 비어 있거나 너무 깁니다(최대 500자).",
|
||||
'notif.review_comment': "님이 내 리뷰에 댓글을 남겼습니다",
|
||||
'notif.shared_list_invite': "님이 공유 목록에 초대했습니다",
|
||||
'settings.notifComments': "내 리뷰에 달린 댓글",
|
||||
'settings.notifLists': "공유 목록 초대",
|
||||
'shared.title': "공유 목록",
|
||||
'shared.hint': "함께 만드는 목록: 모든 멤버가 작품을 추가하거나 뺄 수 있어요.",
|
||||
'shared.new': "새 공유 목록",
|
||||
'shared.namePh': "목록 이름 (예: 같이 볼 영화)",
|
||||
'shared.none': "아직 공유 목록이 없어요. 하나 만들고 친구를 초대해 보세요.",
|
||||
'shared.invitesYou': "님이 초대했습니다:",
|
||||
'shared.accept': "수락",
|
||||
'shared.decline': "거절",
|
||||
'shared.by': "{name} 님의 목록",
|
||||
'shared.badge': "공유 목록",
|
||||
'shared.members': "멤버",
|
||||
'shared.invite': "초대",
|
||||
'shared.owner': "소유자",
|
||||
'shared.pending': "대기 중",
|
||||
'shared.removeMember': "{name} 님을 목록에서 내보내기",
|
||||
'shared.removeTitle': "목록에서 {title} 빼기",
|
||||
'shared.addedBy': "{name} 님이 추가",
|
||||
'shared.emptyText': "작품 페이지나 내 라이브러리에서 작품을 추가하세요.",
|
||||
'shared.delete': "공유 목록 삭제",
|
||||
'shared.deleteConfirm': "‘{name}’ 목록이 모든 멤버에게서 삭제됩니다.",
|
||||
'shared.leave': "목록 나가기",
|
||||
'shared.leaveShort': "나가기",
|
||||
'shared.leaveConfirm': "‘{name}’ 목록이 더 이상 보이지 않습니다. 소유자가 다시 초대할 수 있어요.",
|
||||
'shared.notFound': "목록을 찾을 수 없습니다",
|
||||
'shared.noCandidates': "라이브러리에서 작품을 찾지 못했습니다.",
|
||||
'shared.inviteTitle': "멤버 초대",
|
||||
'shared.inviteHint': "내가 팔로우하거나 나를 팔로우하는 사람을 ‘{name}’에 초대하세요.",
|
||||
'shared.searchPeople': "사용자 이름 검색…",
|
||||
'shared.noPeople': "초대할 사람이 없어요: 팔로워와 내가 팔로우하는 사람만 참여할 수 있습니다.",
|
||||
'shared.inviteShort': "초대",
|
||||
'shared.invited': "초대함",
|
||||
'shared.expired': "초대 만료",
|
||||
'shared.addTo': "공유 목록에 추가",
|
||||
'shared.unavailable': "지금은 공유 목록을 사용할 수 없습니다.",
|
||||
'shared.err.rate': "연속 작업이 너무 많아요. 1분 후 다시 시도하세요.",
|
||||
'shared.err.members': "이 목록의 멤버 수가 최대에 도달했습니다.",
|
||||
'shared.err.lists': "공유 목록 개수가 최대에 도달했습니다.",
|
||||
'shared.err.full': "이 목록이 가득 찼습니다(500편).",
|
||||
'shared.err.notConnected': "팔로워와 내가 팔로우하는 사람만 초대할 수 있어요.",
|
||||
'shared.err.forbidden': "허용되지 않음: 이 목록에 접근할 수 없습니다.",
|
||||
'comments.toggle_one': "댓글 {count}개",
|
||||
'comments.toggle_other': "댓글 {count}개",
|
||||
'shared.nMembers_one': "멤버 {count}명",
|
||||
'shared.nMembers_other': "멤버 {count}명",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} wijziging in wachtrij",
|
||||
'sync.pending_other': "{count} wijzigingen in wachtrij",
|
||||
'sync.now': "Nu synchroniseren",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Bevat spoilers",
|
||||
'spoiler.checkboxHint': "Je recensie wordt voor anderen verborgen tot ze ervoor kiezen hem te lezen.",
|
||||
'spoiler.warning': "Deze recensie bevat spoilers",
|
||||
'spoiler.show': "Spoiler tonen",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Reacties",
|
||||
'comments.none': "Nog geen reacties. Begin het gesprek!",
|
||||
'comments.placeholder': "Schrijf een reactie…",
|
||||
'comments.send': "Versturen",
|
||||
'comments.delete': "Reactie verwijderen",
|
||||
'comments.deleteConfirm': "Deze reactie verwijderen?",
|
||||
'comments.loadError': "Reacties konden niet worden geladen.",
|
||||
'comments.unavailable': "Reacties zijn nu niet beschikbaar.",
|
||||
'comments.err.rate': "Je reageert te snel – probeer het over een minuut opnieuw.",
|
||||
'comments.err.gone': "Deze recensie is niet meer beschikbaar.",
|
||||
'comments.err.invalid': "Reactie leeg of te lang (max. 500 tekens).",
|
||||
'notif.review_comment': "reageerde op je recensie",
|
||||
'notif.shared_list_invite': "nodigde je uit voor de gedeelde lijst",
|
||||
'settings.notifComments': "Reacties op mijn recensies",
|
||||
'settings.notifLists': "Uitnodigingen voor gedeelde lijsten",
|
||||
'shared.title': "Gedeelde lijsten",
|
||||
'shared.hint': "Lijsten voor meerdere mensen: elk lid kan titels toevoegen of verwijderen.",
|
||||
'shared.new': "Nieuwe gedeelde lijst",
|
||||
'shared.namePh': "Naam van de lijst (bijv. Films om samen te kijken)",
|
||||
'shared.none': "Nog geen gedeelde lijsten. Maak er een en nodig je vrienden uit.",
|
||||
'shared.invitesYou': "nodigt je uit voor",
|
||||
'shared.accept': "Accepteren",
|
||||
'shared.decline': "Weigeren",
|
||||
'shared.by': "van {name}",
|
||||
'shared.badge': "Gedeelde lijst",
|
||||
'shared.members': "Leden",
|
||||
'shared.invite': "Uitnodigen",
|
||||
'shared.owner': "Eigenaar",
|
||||
'shared.pending': "In afwachting",
|
||||
'shared.removeMember': "{name} uit de lijst verwijderen",
|
||||
'shared.removeTitle': "{title} uit de lijst verwijderen",
|
||||
'shared.addedBy': "Toegevoegd door {name}",
|
||||
'shared.emptyText': "Voeg titels toe vanaf hun pagina of uit je bibliotheek.",
|
||||
'shared.delete': "Gedeelde lijst verwijderen",
|
||||
'shared.deleteConfirm': "De lijst ‘{name}’ wordt voor alle leden verwijderd.",
|
||||
'shared.leave': "Lijst verlaten",
|
||||
'shared.leaveShort': "Verlaten",
|
||||
'shared.leaveConfirm': "Je ziet de lijst ‘{name}’ niet meer. De eigenaar kan je opnieuw uitnodigen.",
|
||||
'shared.notFound': "Lijst niet gevonden",
|
||||
'shared.noCandidates': "Geen titels gevonden in je bibliotheek.",
|
||||
'shared.inviteTitle': "Leden uitnodigen",
|
||||
'shared.inviteHint': "Nodig mensen die je volgt of die jou volgen uit voor ‘{name}’.",
|
||||
'shared.searchPeople': "Zoek een gebruikersnaam…",
|
||||
'shared.noPeople': "Niemand om uit te nodigen: alleen je volgers en mensen die je volgt kunnen meedoen.",
|
||||
'shared.inviteShort': "Uitnodigen",
|
||||
'shared.invited': "Uitgenodigd",
|
||||
'shared.expired': "uitnodiging verlopen",
|
||||
'shared.addTo': "Toevoegen aan een gedeelde lijst",
|
||||
'shared.unavailable': "Gedeelde lijsten zijn nu niet beschikbaar.",
|
||||
'shared.err.rate': "Te veel acties achter elkaar – probeer het over een minuut opnieuw.",
|
||||
'shared.err.members': "Deze lijst heeft het maximale aantal leden bereikt.",
|
||||
'shared.err.lists': "Je hebt het maximale aantal gedeelde lijsten bereikt.",
|
||||
'shared.err.full': "Deze lijst is vol (500 titels).",
|
||||
'shared.err.notConnected': "Je kunt alleen je volgers en mensen die je volgt uitnodigen.",
|
||||
'shared.err.forbidden': "Niet toegestaan: je hebt geen toegang tot deze lijst.",
|
||||
'comments.toggle_one': "{count} reactie",
|
||||
'comments.toggle_other': "{count} reacties",
|
||||
'shared.nMembers_one': "{count} lid",
|
||||
'shared.nMembers_other': "{count} leden",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -989,6 +989,75 @@ const dict: Translations = {
|
||||
'sync.now': "Synchronizuj",
|
||||
'sync.pending_few': "{count} zmiany oczekują",
|
||||
'sync.pending_many': "{count} zmian oczekuje",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Zawiera spoilery",
|
||||
'spoiler.checkboxHint': "Twoja recenzja będzie ukryta dla innych, dopóki nie zdecydują się jej przeczytać.",
|
||||
'spoiler.warning': "Ta recenzja zawiera spoilery",
|
||||
'spoiler.show': "Pokaż spoiler",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Komentarze",
|
||||
'comments.none': "Brak komentarzy. Rozpocznij rozmowę!",
|
||||
'comments.placeholder': "Napisz komentarz…",
|
||||
'comments.send': "Wyślij",
|
||||
'comments.delete': "Usuń komentarz",
|
||||
'comments.deleteConfirm': "Usunąć ten komentarz?",
|
||||
'comments.loadError': "Nie udało się wczytać komentarzy.",
|
||||
'comments.unavailable': "Komentarze są teraz niedostępne.",
|
||||
'comments.err.rate': "Komentujesz zbyt szybko – spróbuj ponownie za minutę.",
|
||||
'comments.err.gone': "Ta recenzja nie jest już dostępna.",
|
||||
'comments.err.invalid': "Komentarz jest pusty lub za długi (maks. 500 znaków).",
|
||||
'notif.review_comment': "skomentował(a) twoją recenzję",
|
||||
'notif.shared_list_invite': "zaprasza cię do wspólnej listy",
|
||||
'settings.notifComments': "Komentarze do moich recenzji",
|
||||
'settings.notifLists': "Zaproszenia do wspólnych list",
|
||||
'shared.title': "Wspólne listy",
|
||||
'shared.hint': "Listy tworzone razem: każdy członek może dodawać i usuwać tytuły.",
|
||||
'shared.new': "Nowa wspólna lista",
|
||||
'shared.namePh': "Nazwa listy (np. Filmy do obejrzenia we dwoje)",
|
||||
'shared.none': "Brak wspólnych list. Utwórz jedną i zaproś znajomych.",
|
||||
'shared.invitesYou': "zaprasza cię do",
|
||||
'shared.accept': "Akceptuj",
|
||||
'shared.decline': "Odrzuć",
|
||||
'shared.by': "od {name}",
|
||||
'shared.badge': "Wspólna lista",
|
||||
'shared.members': "Członkowie",
|
||||
'shared.invite': "Zaproś",
|
||||
'shared.owner': "Właściciel",
|
||||
'shared.pending': "Oczekuje",
|
||||
'shared.removeMember': "Usuń {name} z listy",
|
||||
'shared.removeTitle': "Usuń {title} z listy",
|
||||
'shared.addedBy': "Dodane przez {name}",
|
||||
'shared.emptyText': "Dodawaj tytuły z ich strony lub ze swojej biblioteki.",
|
||||
'shared.delete': "Usuń wspólną listę",
|
||||
'shared.deleteConfirm': "Lista „{name}” zostanie usunięta dla wszystkich członków.",
|
||||
'shared.leave': "Opuść listę",
|
||||
'shared.leaveShort': "Opuść",
|
||||
'shared.leaveConfirm': "Nie będziesz już widzieć listy „{name}”. Właściciel może zaprosić cię ponownie.",
|
||||
'shared.notFound': "Nie znaleziono listy",
|
||||
'shared.noCandidates': "Nie znaleziono tytułów w twojej bibliotece.",
|
||||
'shared.inviteTitle': "Zaproś członków",
|
||||
'shared.inviteHint': "Zaproś do „{name}” osoby, które obserwujesz lub które obserwują ciebie.",
|
||||
'shared.searchPeople': "Szukaj nazwy użytkownika…",
|
||||
'shared.noPeople': "Nie ma kogo zaprosić: dołączyć mogą tylko twoi obserwujący i obserwowani.",
|
||||
'shared.inviteShort': "Zaproś",
|
||||
'shared.invited': "Zaproszono",
|
||||
'shared.expired': "zaproszenie wygasło",
|
||||
'shared.addTo': "Dodaj do wspólnej listy",
|
||||
'shared.unavailable': "Wspólne listy są teraz niedostępne.",
|
||||
'shared.err.rate': "Zbyt wiele działań naraz – spróbuj ponownie za minutę.",
|
||||
'shared.err.members': "Ta lista osiągnęła maksymalną liczbę członków.",
|
||||
'shared.err.lists': "Osiągnięto maksymalną liczbę wspólnych list.",
|
||||
'shared.err.full': "Ta lista jest pełna (500 tytułów).",
|
||||
'shared.err.notConnected': "Możesz zapraszać tylko obserwujących i obserwowanych.",
|
||||
'shared.err.forbidden': "Niedozwolone: nie masz dostępu do tej listy.",
|
||||
'comments.toggle_one': "{count} komentarz",
|
||||
'comments.toggle_few': "{count} komentarze",
|
||||
'comments.toggle_many': "{count} komentarzy",
|
||||
'comments.toggle_other': "{count} komentarza",
|
||||
'shared.nMembers_one': "{count} członek",
|
||||
'shared.nMembers_few': "{count} członków",
|
||||
'shared.nMembers_many': "{count} członków",
|
||||
'shared.nMembers_other': "{count} członka",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} alteração pendente",
|
||||
'sync.pending_other': "{count} alterações pendentes",
|
||||
'sync.now': "Sincronizar",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Contém spoilers",
|
||||
'spoiler.checkboxHint': "Sua resenha ficará oculta para os outros até que escolham lê-la.",
|
||||
'spoiler.warning': "Esta resenha contém spoilers",
|
||||
'spoiler.show': "Mostrar spoiler",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Comentários",
|
||||
'comments.none': "Nenhum comentário ainda. Comece a conversa!",
|
||||
'comments.placeholder': "Escreva um comentário…",
|
||||
'comments.send': "Enviar",
|
||||
'comments.delete': "Excluir comentário",
|
||||
'comments.deleteConfirm': "Excluir este comentário?",
|
||||
'comments.loadError': "Não foi possível carregar os comentários.",
|
||||
'comments.unavailable': "Comentários indisponíveis no momento.",
|
||||
'comments.err.rate': "Você está comentando rápido demais: tente de novo em um minuto.",
|
||||
'comments.err.gone': "Esta resenha não está mais disponível.",
|
||||
'comments.err.invalid': "Comentário vazio ou longo demais (máx. 500 caracteres).",
|
||||
'notif.review_comment': "comentou sua resenha",
|
||||
'notif.shared_list_invite': "convidou você para a lista compartilhada",
|
||||
'settings.notifComments': "Comentários nas minhas resenhas",
|
||||
'settings.notifLists': "Convites para listas compartilhadas",
|
||||
'shared.title': "Listas compartilhadas",
|
||||
'shared.hint': "Listas a várias mãos: cada membro pode adicionar ou remover títulos.",
|
||||
'shared.new': "Nova lista compartilhada",
|
||||
'shared.namePh': "Nome da lista (ex.: Filmes para ver a dois)",
|
||||
'shared.none': "Nenhuma lista compartilhada. Crie uma e convide seus amigos.",
|
||||
'shared.invitesYou': "convidou você para entrar em",
|
||||
'shared.accept': "Aceitar",
|
||||
'shared.decline': "Recusar",
|
||||
'shared.by': "de {name}",
|
||||
'shared.badge': "Lista compartilhada",
|
||||
'shared.members': "Membros",
|
||||
'shared.invite': "Convidar",
|
||||
'shared.owner': "Dono",
|
||||
'shared.pending': "Pendente",
|
||||
'shared.removeMember': "Remover {name} da lista",
|
||||
'shared.removeTitle': "Remover {title} da lista",
|
||||
'shared.addedBy': "Adicionado por {name}",
|
||||
'shared.emptyText': "Adicione títulos pela página deles ou pela sua biblioteca.",
|
||||
'shared.delete': "Excluir lista compartilhada",
|
||||
'shared.deleteConfirm': "A lista “{name}” será excluída para todos os membros.",
|
||||
'shared.leave': "Sair da lista",
|
||||
'shared.leaveShort': "Sair",
|
||||
'shared.leaveConfirm': "Você não verá mais a lista “{name}”. O dono poderá convidar você de novo.",
|
||||
'shared.notFound': "Lista não encontrada",
|
||||
'shared.noCandidates': "Nenhum título encontrado na sua biblioteca.",
|
||||
'shared.inviteTitle': "Convidar membros",
|
||||
'shared.inviteHint': "Convide para “{name}” pessoas que você segue ou que seguem você.",
|
||||
'shared.searchPeople': "Buscar um usuário…",
|
||||
'shared.noPeople': "Ninguém para convidar: só seus seguidores e quem você segue podem entrar.",
|
||||
'shared.inviteShort': "Convidar",
|
||||
'shared.invited': "Convidado",
|
||||
'shared.expired': "convite expirado",
|
||||
'shared.addTo': "Adicionar a uma lista compartilhada",
|
||||
'shared.unavailable': "Listas compartilhadas indisponíveis no momento.",
|
||||
'shared.err.rate': "Muitas ações seguidas: tente de novo em um minuto.",
|
||||
'shared.err.members': "Esta lista atingiu o número máximo de membros.",
|
||||
'shared.err.lists': "Você atingiu o número máximo de listas compartilhadas.",
|
||||
'shared.err.full': "Esta lista está cheia (500 títulos).",
|
||||
'shared.err.notConnected': "Você só pode convidar seus seguidores e quem você segue.",
|
||||
'shared.err.forbidden': "Ação não permitida: você não tem acesso a esta lista.",
|
||||
'comments.toggle_one': "{count} comentário",
|
||||
'comments.toggle_other': "{count} comentários",
|
||||
'shared.nMembers_one': "{count} membro",
|
||||
'shared.nMembers_other': "{count} membros",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -989,6 +989,75 @@ const dict: Translations = {
|
||||
'sync.now': "Синхронизировать",
|
||||
'sync.pending_few': "{count} изменения ожидают",
|
||||
'sync.pending_many': "{count} изменений ожидают",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Содержит спойлеры",
|
||||
'spoiler.checkboxHint': "Ваш отзыв будет скрыт от других, пока они сами не решат его прочитать.",
|
||||
'spoiler.warning': "Этот отзыв содержит спойлеры",
|
||||
'spoiler.show': "Показать спойлер",
|
||||
'spoiler.badge': "Спойлер",
|
||||
'comments.title': "Комментарии",
|
||||
'comments.none': "Комментариев пока нет. Начните обсуждение!",
|
||||
'comments.placeholder': "Написать комментарий…",
|
||||
'comments.send': "Отправить",
|
||||
'comments.delete': "Удалить комментарий",
|
||||
'comments.deleteConfirm': "Удалить этот комментарий?",
|
||||
'comments.loadError': "Не удалось загрузить комментарии.",
|
||||
'comments.unavailable': "Комментарии сейчас недоступны.",
|
||||
'comments.err.rate': "Вы комментируете слишком часто — попробуйте через минуту.",
|
||||
'comments.err.gone': "Этот отзыв больше недоступен.",
|
||||
'comments.err.invalid': "Комментарий пустой или слишком длинный (макс. 500 символов).",
|
||||
'notif.review_comment': "прокомментировал(а) ваш отзыв",
|
||||
'notif.shared_list_invite': "приглашает вас в общий список",
|
||||
'settings.notifComments': "Комментарии к моим отзывам",
|
||||
'settings.notifLists': "Приглашения в общие списки",
|
||||
'shared.title': "Общие списки",
|
||||
'shared.hint': "Списки на несколько человек: каждый участник может добавлять и удалять тайтлы.",
|
||||
'shared.new': "Новый общий список",
|
||||
'shared.namePh': "Название списка (напр. Фильмы посмотреть вдвоём)",
|
||||
'shared.none': "Общих списков пока нет. Создайте список и пригласите друзей.",
|
||||
'shared.invitesYou': "приглашает вас в",
|
||||
'shared.accept': "Принять",
|
||||
'shared.decline': "Отклонить",
|
||||
'shared.by': "от {name}",
|
||||
'shared.badge': "Общий список",
|
||||
'shared.members': "Участники",
|
||||
'shared.invite': "Пригласить",
|
||||
'shared.owner': "Владелец",
|
||||
'shared.pending': "Ожидает",
|
||||
'shared.removeMember': "Удалить {name} из списка",
|
||||
'shared.removeTitle': "Удалить «{title}» из списка",
|
||||
'shared.addedBy': "Добавил(а) {name}",
|
||||
'shared.emptyText': "Добавляйте тайтлы с их страницы или из своей библиотеки.",
|
||||
'shared.delete': "Удалить общий список",
|
||||
'shared.deleteConfirm': "Список «{name}» будет удалён для всех участников.",
|
||||
'shared.leave': "Покинуть список",
|
||||
'shared.leaveShort': "Покинуть",
|
||||
'shared.leaveConfirm': "Вы больше не увидите список «{name}». Владелец сможет пригласить вас снова.",
|
||||
'shared.notFound': "Список не найден",
|
||||
'shared.noCandidates': "В вашей библиотеке ничего не найдено.",
|
||||
'shared.inviteTitle': "Пригласить участников",
|
||||
'shared.inviteHint': "Пригласите в «{name}» тех, на кого вы подписаны или кто подписан на вас.",
|
||||
'shared.searchPeople': "Найти по имени пользователя…",
|
||||
'shared.noPeople': "Некого пригласить: вступить могут только ваши подписчики и подписки.",
|
||||
'shared.inviteShort': "Пригласить",
|
||||
'shared.invited': "Приглашён",
|
||||
'shared.expired': "приглашение устарело",
|
||||
'shared.addTo': "Добавить в общий список",
|
||||
'shared.unavailable': "Общие списки сейчас недоступны.",
|
||||
'shared.err.rate': "Слишком много действий подряд — попробуйте через минуту.",
|
||||
'shared.err.members': "В списке уже максимальное число участников.",
|
||||
'shared.err.lists': "Достигнуто максимальное число общих списков.",
|
||||
'shared.err.full': "Список заполнен (500 тайтлов).",
|
||||
'shared.err.notConnected': "Приглашать можно только подписчиков и подписки.",
|
||||
'shared.err.forbidden': "Действие недоступно: у вас нет доступа к этому списку.",
|
||||
'comments.toggle_one': "{count} комментарий",
|
||||
'comments.toggle_few': "{count} комментария",
|
||||
'comments.toggle_many': "{count} комментариев",
|
||||
'comments.toggle_other': "{count} комментария",
|
||||
'shared.nMembers_one': "{count} участник",
|
||||
'shared.nMembers_few': "{count} участника",
|
||||
'shared.nMembers_many': "{count} участников",
|
||||
'shared.nMembers_other': "{count} участника",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "รอซิงค์ {count} รายการ",
|
||||
'sync.pending_other': "รอซิงค์ {count} รายการ",
|
||||
'sync.now': "ซิงค์ตอนนี้",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "มีสปอยล์",
|
||||
'spoiler.checkboxHint': "รีวิวของคุณจะถูกซ่อนจากคนอื่นจนกว่าพวกเขาจะเลือกอ่าน",
|
||||
'spoiler.warning': "รีวิวนี้มีสปอยล์",
|
||||
'spoiler.show': "แสดงสปอยล์",
|
||||
'spoiler.badge': "สปอยล์",
|
||||
'comments.title': "ความคิดเห็น",
|
||||
'comments.none': "ยังไม่มีความคิดเห็น เริ่มคุยกันเลย!",
|
||||
'comments.placeholder': "เขียนความคิดเห็น…",
|
||||
'comments.send': "ส่ง",
|
||||
'comments.delete': "ลบความคิดเห็น",
|
||||
'comments.deleteConfirm': "ลบความคิดเห็นนี้ไหม?",
|
||||
'comments.loadError': "โหลดความคิดเห็นไม่ได้",
|
||||
'comments.unavailable': "ความคิดเห็นยังใช้งานไม่ได้ในขณะนี้",
|
||||
'comments.err.rate': "คุณแสดงความคิดเห็นเร็วเกินไป ลองใหม่ในอีกหนึ่งนาที",
|
||||
'comments.err.gone': "รีวิวนี้ไม่มีให้ดูแล้ว",
|
||||
'comments.err.invalid': "ความคิดเห็นว่างหรือยาวเกินไป (สูงสุด 500 ตัวอักษร)",
|
||||
'notif.review_comment': "แสดงความคิดเห็นในรีวิวของคุณ",
|
||||
'notif.shared_list_invite': "เชิญคุณเข้ารายการที่แชร์",
|
||||
'settings.notifComments': "ความคิดเห็นในรีวิวของฉัน",
|
||||
'settings.notifLists': "คำเชิญเข้ารายการที่แชร์",
|
||||
'shared.title': "รายการที่แชร์",
|
||||
'shared.hint': "รายการที่ทำร่วมกัน: สมาชิกทุกคนเพิ่มหรือนำเรื่องออกได้",
|
||||
'shared.new': "รายการที่แชร์ใหม่",
|
||||
'shared.namePh': "ชื่อรายการ (เช่น หนังที่จะดูด้วยกัน)",
|
||||
'shared.none': "ยังไม่มีรายการที่แชร์ สร้างสักรายการแล้วชวนเพื่อนสิ",
|
||||
'shared.invitesYou': "เชิญคุณเข้าร่วม",
|
||||
'shared.accept': "ยอมรับ",
|
||||
'shared.decline': "ปฏิเสธ",
|
||||
'shared.by': "โดย {name}",
|
||||
'shared.badge': "รายการที่แชร์",
|
||||
'shared.members': "สมาชิก",
|
||||
'shared.invite': "เชิญ",
|
||||
'shared.owner': "เจ้าของ",
|
||||
'shared.pending': "รอตอบรับ",
|
||||
'shared.removeMember': "นำ {name} ออกจากรายการ",
|
||||
'shared.removeTitle': "นำ {title} ออกจากรายการ",
|
||||
'shared.addedBy': "{name} เพิ่ม",
|
||||
'shared.emptyText': "เพิ่มเรื่องจากหน้าของเรื่องนั้นหรือจากคลังของคุณ",
|
||||
'shared.delete': "ลบรายการที่แชร์",
|
||||
'shared.deleteConfirm': "รายการ “{name}” จะถูกลบสำหรับสมาชิกทุกคน",
|
||||
'shared.leave': "ออกจากรายการ",
|
||||
'shared.leaveShort': "ออก",
|
||||
'shared.leaveConfirm': "คุณจะไม่เห็นรายการ “{name}” อีก เจ้าของสามารถเชิญคุณใหม่ได้",
|
||||
'shared.notFound': "ไม่พบรายการ",
|
||||
'shared.noCandidates': "ไม่พบเรื่องในคลังของคุณ",
|
||||
'shared.inviteTitle': "เชิญสมาชิก",
|
||||
'shared.inviteHint': "เชิญคนที่คุณติดตามหรือที่ติดตามคุณเข้า “{name}”",
|
||||
'shared.searchPeople': "ค้นหาชื่อผู้ใช้…",
|
||||
'shared.noPeople': "ไม่มีใครให้เชิญ: เฉพาะผู้ติดตามและคนที่คุณติดตามเท่านั้นที่เข้าร่วมได้",
|
||||
'shared.inviteShort': "เชิญ",
|
||||
'shared.invited': "เชิญแล้ว",
|
||||
'shared.expired': "คำเชิญหมดอายุ",
|
||||
'shared.addTo': "เพิ่มในรายการที่แชร์",
|
||||
'shared.unavailable': "รายการที่แชร์ยังใช้งานไม่ได้ในขณะนี้",
|
||||
'shared.err.rate': "ทำรายการติดกันมากเกินไป ลองใหม่ในอีกหนึ่งนาที",
|
||||
'shared.err.members': "รายการนี้มีสมาชิกครบจำนวนสูงสุดแล้ว",
|
||||
'shared.err.lists': "คุณมีรายการที่แชร์ครบจำนวนสูงสุดแล้ว",
|
||||
'shared.err.full': "รายการนี้เต็มแล้ว (500 เรื่อง)",
|
||||
'shared.err.notConnected': "คุณเชิญได้เฉพาะผู้ติดตามและคนที่คุณติดตาม",
|
||||
'shared.err.forbidden': "ไม่อนุญาต: คุณไม่มีสิทธิ์เข้าถึงรายการนี้",
|
||||
'comments.toggle_one': "{count} ความคิดเห็น",
|
||||
'comments.toggle_other': "{count} ความคิดเห็น",
|
||||
'shared.nMembers_one': "สมาชิก {count} คน",
|
||||
'shared.nMembers_other': "สมาชิก {count} คน",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} değişiklik bekliyor",
|
||||
'sync.pending_other': "{count} değişiklik bekliyor",
|
||||
'sync.now': "Şimdi eşitle",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Spoiler içerir",
|
||||
'spoiler.checkboxHint': "İncelemen, başkaları okumayı seçene kadar gizlenecek.",
|
||||
'spoiler.warning': "Bu inceleme spoiler içeriyor",
|
||||
'spoiler.show': "Spoiler’ı göster",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Yorumlar",
|
||||
'comments.none': "Henüz yorum yok. Sohbeti sen başlat!",
|
||||
'comments.placeholder': "Yorum yaz…",
|
||||
'comments.send': "Gönder",
|
||||
'comments.delete': "Yorumu sil",
|
||||
'comments.deleteConfirm': "Bu yorum silinsin mi?",
|
||||
'comments.loadError': "Yorumlar yüklenemedi.",
|
||||
'comments.unavailable': "Yorumlar şu anda kullanılamıyor.",
|
||||
'comments.err.rate': "Çok hızlı yorum yapıyorsun, bir dakika sonra tekrar dene.",
|
||||
'comments.err.gone': "Bu inceleme artık mevcut değil.",
|
||||
'comments.err.invalid': "Yorum boş ya da çok uzun (en fazla 500 karakter).",
|
||||
'notif.review_comment': "incelemene yorum yaptı",
|
||||
'notif.shared_list_invite': "seni ortak listeye davet etti",
|
||||
'settings.notifComments': "İncelemelerime yapılan yorumlar",
|
||||
'settings.notifLists': "Ortak liste davetleri",
|
||||
'shared.title': "Ortak listeler",
|
||||
'shared.hint': "Birlikte oluşturulan listeler: her üye başlık ekleyip çıkarabilir.",
|
||||
'shared.new': "Yeni ortak liste",
|
||||
'shared.namePh': "Liste adı (ör. Birlikte izlenecek filmler)",
|
||||
'shared.none': "Henüz ortak liste yok. Bir tane oluştur ve arkadaşlarını davet et.",
|
||||
'shared.invitesYou': "seni şu listeye davet etti:",
|
||||
'shared.accept': "Kabul et",
|
||||
'shared.decline': "Reddet",
|
||||
'shared.by': "{name} tarafından",
|
||||
'shared.badge': "Ortak liste",
|
||||
'shared.members': "Üyeler",
|
||||
'shared.invite': "Davet et",
|
||||
'shared.owner': "Sahibi",
|
||||
'shared.pending': "Bekliyor",
|
||||
'shared.removeMember': "{name} listeden çıkar",
|
||||
'shared.removeTitle': "{title} listeden çıkar",
|
||||
'shared.addedBy': "{name} ekledi",
|
||||
'shared.emptyText': "Başlıkları kendi sayfalarından ya da kütüphanenden ekle.",
|
||||
'shared.delete': "Ortak listeyi sil",
|
||||
'shared.deleteConfirm': "“{name}” listesi tüm üyeler için silinecek.",
|
||||
'shared.leave': "Listeden ayrıl",
|
||||
'shared.leaveShort': "Ayrıl",
|
||||
'shared.leaveConfirm': "“{name}” listesini artık görmeyeceksin. Sahibi seni yeniden davet edebilir.",
|
||||
'shared.notFound': "Liste bulunamadı",
|
||||
'shared.noCandidates': "Kütüphanende başlık bulunamadı.",
|
||||
'shared.inviteTitle': "Üye davet et",
|
||||
'shared.inviteHint': "Takip ettiğin ya da seni takip eden kişileri “{name}” listesine davet et.",
|
||||
'shared.searchPeople': "Kullanıcı adı ara…",
|
||||
'shared.noPeople': "Davet edilecek kimse yok: yalnızca takipçilerin ve takip ettiklerin katılabilir.",
|
||||
'shared.inviteShort': "Davet et",
|
||||
'shared.invited': "Davet edildi",
|
||||
'shared.expired': "davetin süresi doldu",
|
||||
'shared.addTo': "Ortak listeye ekle",
|
||||
'shared.unavailable': "Ortak listeler şu anda kullanılamıyor.",
|
||||
'shared.err.rate': "Art arda çok fazla işlem, bir dakika sonra tekrar dene.",
|
||||
'shared.err.members': "Bu liste azami üye sayısına ulaştı.",
|
||||
'shared.err.lists': "Azami ortak liste sayısına ulaştın.",
|
||||
'shared.err.full': "Bu liste dolu (500 başlık).",
|
||||
'shared.err.notConnected': "Yalnızca takipçilerini ve takip ettiklerini davet edebilirsin.",
|
||||
'shared.err.forbidden': "İzin verilmiyor: bu listeye erişimin yok.",
|
||||
'comments.toggle_one': "{count} yorum",
|
||||
'comments.toggle_other': "{count} yorum",
|
||||
'shared.nMembers_one': "{count} üye",
|
||||
'shared.nMembers_other': "{count} üye",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} thay đổi đang chờ",
|
||||
'sync.pending_other': "{count} thay đổi đang chờ",
|
||||
'sync.now': "Đồng bộ ngay",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "Có tiết lộ nội dung",
|
||||
'spoiler.checkboxHint': "Bài đánh giá của bạn sẽ bị ẩn với người khác cho đến khi họ chọn đọc.",
|
||||
'spoiler.warning': "Bài đánh giá này có tiết lộ nội dung",
|
||||
'spoiler.show': "Hiện nội dung",
|
||||
'spoiler.badge': "Spoiler",
|
||||
'comments.title': "Bình luận",
|
||||
'comments.none': "Chưa có bình luận. Hãy bắt đầu cuộc trò chuyện!",
|
||||
'comments.placeholder': "Viết bình luận…",
|
||||
'comments.send': "Gửi",
|
||||
'comments.delete': "Xóa bình luận",
|
||||
'comments.deleteConfirm': "Xóa bình luận này?",
|
||||
'comments.loadError': "Không tải được bình luận.",
|
||||
'comments.unavailable': "Bình luận hiện chưa khả dụng.",
|
||||
'comments.err.rate': "Bạn bình luận quá nhanh — hãy thử lại sau một phút.",
|
||||
'comments.err.gone': "Bài đánh giá này không còn nữa.",
|
||||
'comments.err.invalid': "Bình luận trống hoặc quá dài (tối đa 500 ký tự).",
|
||||
'notif.review_comment': "đã bình luận bài đánh giá của bạn",
|
||||
'notif.shared_list_invite': "đã mời bạn vào danh sách chung",
|
||||
'settings.notifComments': "Bình luận về đánh giá của tôi",
|
||||
'settings.notifLists': "Lời mời vào danh sách chung",
|
||||
'shared.title': "Danh sách chung",
|
||||
'shared.hint': "Danh sách làm cùng nhau: mọi thành viên đều có thể thêm hoặc bớt phim.",
|
||||
'shared.new': "Danh sách chung mới",
|
||||
'shared.namePh': "Tên danh sách (vd: Phim xem cùng nhau)",
|
||||
'shared.none': "Chưa có danh sách chung. Hãy tạo một danh sách và mời bạn bè.",
|
||||
'shared.invitesYou': "mời bạn tham gia",
|
||||
'shared.accept': "Chấp nhận",
|
||||
'shared.decline': "Từ chối",
|
||||
'shared.by': "của {name}",
|
||||
'shared.badge': "Danh sách chung",
|
||||
'shared.members': "Thành viên",
|
||||
'shared.invite': "Mời",
|
||||
'shared.owner': "Chủ sở hữu",
|
||||
'shared.pending': "Đang chờ",
|
||||
'shared.removeMember': "Xóa {name} khỏi danh sách",
|
||||
'shared.removeTitle': "Bỏ {title} khỏi danh sách",
|
||||
'shared.addedBy': "{name} đã thêm",
|
||||
'shared.emptyText': "Thêm phim từ trang của phim hoặc từ thư viện của bạn.",
|
||||
'shared.delete': "Xóa danh sách chung",
|
||||
'shared.deleteConfirm': "Danh sách “{name}” sẽ bị xóa với mọi thành viên.",
|
||||
'shared.leave': "Rời danh sách",
|
||||
'shared.leaveShort': "Rời",
|
||||
'shared.leaveConfirm': "Bạn sẽ không thấy danh sách “{name}” nữa. Chủ sở hữu có thể mời lại bạn.",
|
||||
'shared.notFound': "Không tìm thấy danh sách",
|
||||
'shared.noCandidates': "Không tìm thấy phim nào trong thư viện của bạn.",
|
||||
'shared.inviteTitle': "Mời thành viên",
|
||||
'shared.inviteHint': "Mời những người bạn theo dõi hoặc theo dõi bạn vào “{name}”.",
|
||||
'shared.searchPeople': "Tìm tên người dùng…",
|
||||
'shared.noPeople': "Không có ai để mời: chỉ người theo dõi bạn và người bạn theo dõi mới tham gia được.",
|
||||
'shared.inviteShort': "Mời",
|
||||
'shared.invited': "Đã mời",
|
||||
'shared.expired': "lời mời đã hết hạn",
|
||||
'shared.addTo': "Thêm vào danh sách chung",
|
||||
'shared.unavailable': "Danh sách chung hiện chưa khả dụng.",
|
||||
'shared.err.rate': "Quá nhiều thao tác liên tiếp — hãy thử lại sau một phút.",
|
||||
'shared.err.members': "Danh sách này đã đủ số thành viên tối đa.",
|
||||
'shared.err.lists': "Bạn đã đạt số danh sách chung tối đa.",
|
||||
'shared.err.full': "Danh sách này đã đầy (500 phim).",
|
||||
'shared.err.notConnected': "Bạn chỉ có thể mời người theo dõi bạn và người bạn theo dõi.",
|
||||
'shared.err.forbidden': "Không được phép: bạn không có quyền truy cập danh sách này.",
|
||||
'comments.toggle_one': "{count} bình luận",
|
||||
'comments.toggle_other': "{count} bình luận",
|
||||
'shared.nMembers_one': "{count} thành viên",
|
||||
'shared.nMembers_other': "{count} thành viên",
|
||||
}
|
||||
|
||||
export default dict
|
||||
@@ -897,6 +897,71 @@ const dict: Translations = {
|
||||
'sync.pending_one': "{count} 项更改待上传",
|
||||
'sync.pending_other': "{count} 项更改待上传",
|
||||
'sync.now': "立即同步",
|
||||
// — Social : spoilers, commentaires sous les avis, listes partagées —
|
||||
'spoiler.checkbox': "包含剧透",
|
||||
'spoiler.checkboxHint': "你的评论会对其他人隐藏,直到他们选择阅读。",
|
||||
'spoiler.warning': "此评论包含剧透",
|
||||
'spoiler.show': "显示剧透",
|
||||
'spoiler.badge': "剧透",
|
||||
'comments.title': "评论",
|
||||
'comments.none': "还没有评论,来开启讨论吧!",
|
||||
'comments.placeholder': "写评论…",
|
||||
'comments.send': "发送",
|
||||
'comments.delete': "删除评论",
|
||||
'comments.deleteConfirm': "删除这条评论?",
|
||||
'comments.loadError': "无法加载评论。",
|
||||
'comments.unavailable': "评论功能暂不可用。",
|
||||
'comments.err.rate': "你评论得太快了,请一分钟后再试。",
|
||||
'comments.err.gone': "此评论已不存在。",
|
||||
'comments.err.invalid': "评论为空或过长(最多 500 字)。",
|
||||
'notif.review_comment': "评论了你的影评",
|
||||
'notif.shared_list_invite': "邀请你加入共享片单",
|
||||
'settings.notifComments': "我的影评收到的评论",
|
||||
'settings.notifLists': "共享片单邀请",
|
||||
'shared.title': "共享片单",
|
||||
'shared.hint': "多人共建的片单:每位成员都可以添加或移除作品。",
|
||||
'shared.new': "新建共享片单",
|
||||
'shared.namePh': "片单名称(例如:一起看的电影)",
|
||||
'shared.none': "还没有共享片单。创建一个并邀请好友吧。",
|
||||
'shared.invitesYou': "邀请你加入",
|
||||
'shared.accept': "接受",
|
||||
'shared.decline': "拒绝",
|
||||
'shared.by': "来自 {name}",
|
||||
'shared.badge': "共享片单",
|
||||
'shared.members': "成员",
|
||||
'shared.invite': "邀请",
|
||||
'shared.owner': "创建者",
|
||||
'shared.pending': "待接受",
|
||||
'shared.removeMember': "将 {name} 移出片单",
|
||||
'shared.removeTitle': "从片单中移除《{title}》",
|
||||
'shared.addedBy': "{name} 添加",
|
||||
'shared.emptyText': "可以从作品页面或你的片库中添加作品。",
|
||||
'shared.delete': "删除共享片单",
|
||||
'shared.deleteConfirm': "片单“{name}”将对所有成员删除。",
|
||||
'shared.leave': "退出片单",
|
||||
'shared.leaveShort': "退出",
|
||||
'shared.leaveConfirm': "你将不再看到片单“{name}”。创建者可以再次邀请你。",
|
||||
'shared.notFound': "找不到片单",
|
||||
'shared.noCandidates': "你的片库中没有找到作品。",
|
||||
'shared.inviteTitle': "邀请成员",
|
||||
'shared.inviteHint': "邀请你关注的人或关注你的人加入“{name}”。",
|
||||
'shared.searchPeople': "搜索用户名…",
|
||||
'shared.noPeople': "没有可邀请的人:只有你的粉丝和你关注的人可以加入。",
|
||||
'shared.inviteShort': "邀请",
|
||||
'shared.invited': "已邀请",
|
||||
'shared.expired': "邀请已失效",
|
||||
'shared.addTo': "添加到共享片单",
|
||||
'shared.unavailable': "共享片单暂不可用。",
|
||||
'shared.err.rate': "连续操作过多,请一分钟后再试。",
|
||||
'shared.err.members': "该片单成员已达上限。",
|
||||
'shared.err.lists': "你的共享片单数量已达上限。",
|
||||
'shared.err.full': "该片单已满(500 部)。",
|
||||
'shared.err.notConnected': "你只能邀请你的粉丝和你关注的人。",
|
||||
'shared.err.forbidden': "无法操作:你无权访问此片单。",
|
||||
'comments.toggle_one': "{count} 条评论",
|
||||
'comments.toggle_other': "{count} 条评论",
|
||||
'shared.nMembers_one': "{count} 位成员",
|
||||
'shared.nMembers_other': "{count} 位成员",
|
||||
}
|
||||
|
||||
export default dict
|
||||
+2
-1
@@ -105,6 +105,7 @@ export function normalizeItem(raw: unknown): MediaItem | null {
|
||||
genres: safeStringList(r.genres, LIMITS.genres),
|
||||
platform: cleanText(r.platform, LIMITS.shortText),
|
||||
notes: cleanText(r.notes, LIMITS.notes),
|
||||
notesSpoiler: (r.notesSpoiler === true && !!cleanText(r.notes, LIMITS.notes)) || undefined,
|
||||
poster: safePosterUrl(r.poster),
|
||||
backdrop: remoteImage(r.backdrop),
|
||||
overview: cleanText(r.overview, LIMITS.overview),
|
||||
@@ -132,7 +133,7 @@ export function normalizeSettings(raw: unknown): Partial<Settings> | undefined {
|
||||
if (raw.themeMode === 'auto' || raw.themeMode === 'light' || raw.themeMode === 'dark' || raw.themeMode === 'night' || raw.themeMode === 'starfield') out.themeMode = raw.themeMode
|
||||
if (isPlainObject(raw.notifPrefs)) {
|
||||
const np: NotifPrefs = {}
|
||||
for (const k of ['episodes', 'follows', 'accepted', 'reactions'] as const) if (typeof raw.notifPrefs[k] === 'boolean') np[k] = raw.notifPrefs[k] as boolean
|
||||
for (const k of ['episodes', 'follows', 'accepted', 'reactions', 'comments', 'lists'] as const) if (typeof raw.notifPrefs[k] === 'boolean') np[k] = raw.notifPrefs[k] as boolean
|
||||
out.notifPrefs = np
|
||||
}
|
||||
return out
|
||||
|
||||
@@ -1168,3 +1168,11 @@ export function getTitleExtras(externalId: string, tmdbKey?: string): Promise<Ti
|
||||
p.catch(() => extrasCache.delete(externalId))
|
||||
return p
|
||||
}
|
||||
|
||||
/** Adresse de l'affiche TMDB d'un titre (listes partagées : la copie locale de l'affiche ne se partage pas). */
|
||||
export async function getTmdbPosterUrl(externalId: string, key: string): Promise<string | undefined> {
|
||||
if (!isSafeExternalId(externalId) || !externalId.startsWith('tmdb:')) return undefined
|
||||
const [, kind, id] = externalId.split(':') as ['tmdb', 'movie' | 'tv', string]
|
||||
const d = await tmdbFetch<{ poster_path?: string | null }>(`/${kind}/${id}`, key)
|
||||
return isSafeTmdbPath(d.poster_path) ? `${TMDB_IMG}/w342${d.poster_path}` : undefined
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import { t } from '../../i18n'
|
||||
import { cleanText, isPlainObject, safeIso } from '../security'
|
||||
import { cloudFetch } from './api'
|
||||
import { safeMediaUrl } from './social'
|
||||
|
||||
/**
|
||||
* Commentaires sous les avis. Lecture / écriture uniquement via les fonctions de la base
|
||||
* (get_review_comments, add_review_comment, delete_review_comment) qui vérifient les droits :
|
||||
* mêmes règles de visibilité que l'avis, anti-spam, suppression par l'auteur, l'auteur de l'avis ou un admin.
|
||||
*/
|
||||
|
||||
export const COMMENT_MAX = 500
|
||||
|
||||
export interface CommentAuthor {
|
||||
id: string
|
||||
username: string
|
||||
displayName: string
|
||||
avatarUrl?: string
|
||||
}
|
||||
|
||||
export interface ReviewComment {
|
||||
id: number
|
||||
body: string
|
||||
createdAt: string
|
||||
user: CommentAuthor
|
||||
mine: boolean
|
||||
canDelete: boolean
|
||||
}
|
||||
|
||||
export interface CommentThread {
|
||||
/** L'avis existe et je peux le voir */
|
||||
visible: boolean
|
||||
/** Je peux supprimer tous les commentaires (auteur de l'avis ou admin) */
|
||||
canModerate: boolean
|
||||
comments: ReviewComment[]
|
||||
}
|
||||
|
||||
/** La base n'a pas encore les commentaires (migration pas appliquée) : la fonctionnalité se masque. */
|
||||
export class CommentsUnavailable extends Error {}
|
||||
|
||||
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
|
||||
const USERNAME = /^[a-z0-9_]{3,20}$/
|
||||
|
||||
async function rpc(name: string, args: Record<string, unknown>): Promise<unknown> {
|
||||
const res = await cloudFetch(`/rest/v1/rpc/${name}`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(args),
|
||||
})
|
||||
if (res.ok) return res.json()
|
||||
if (res.status === 404) throw new CommentsUnavailable(t('comments.unavailable'))
|
||||
const body = (await res.json().catch(() => ({}))) as { message?: string }
|
||||
const msg = typeof body.message === 'string' ? body.message : ''
|
||||
if (msg.includes('rate limit')) throw new Error(t('comments.err.rate'))
|
||||
if (msg.includes('review not found')) throw new Error(t('comments.err.gone'))
|
||||
if (msg.includes('invalid comment')) throw new Error(t('comments.err.invalid'))
|
||||
throw new Error(t('social.err.server', { status: res.status }))
|
||||
}
|
||||
|
||||
function toComment(v: unknown): ReviewComment | null {
|
||||
if (!isPlainObject(v) || typeof v.id !== 'number' || !isPlainObject(v.user)) return null
|
||||
const u = v.user
|
||||
const body = cleanText(v.body, COMMENT_MAX)
|
||||
const createdAt = safeIso(v.created_at)
|
||||
if (!body || !createdAt || typeof u.id !== 'string' || !UUID.test(u.id) || typeof u.username !== 'string' || !USERNAME.test(u.username)) return null
|
||||
return {
|
||||
id: v.id,
|
||||
body,
|
||||
createdAt,
|
||||
user: { id: u.id, username: u.username, displayName: cleanText(u.display_name, 40) ?? u.username, avatarUrl: safeMediaUrl(u.avatar_url) },
|
||||
mine: v.mine === true,
|
||||
canDelete: v.can_delete === true,
|
||||
}
|
||||
}
|
||||
|
||||
export async function getReviewComments(authorId: string, itemId: string): Promise<CommentThread> {
|
||||
if (!UUID.test(authorId)) return { visible: false, canModerate: false, comments: [] }
|
||||
const raw = await rpc('get_review_comments', { p_author: authorId, p_item: itemId })
|
||||
if (!isPlainObject(raw)) return { visible: false, canModerate: false, comments: [] }
|
||||
return {
|
||||
visible: raw.visible === true,
|
||||
canModerate: raw.can_moderate === true,
|
||||
comments: (Array.isArray(raw.comments) ? raw.comments.slice(0, 300) : []).map(toComment).filter((c): c is ReviewComment => c !== null),
|
||||
}
|
||||
}
|
||||
|
||||
export async function addReviewComment(authorId: string, itemId: string, body: string): Promise<ReviewComment> {
|
||||
const text = body.trim().slice(0, COMMENT_MAX)
|
||||
const c = toComment(await rpc('add_review_comment', { p_author: authorId, p_item: itemId, p_body: text }))
|
||||
if (!c) throw new Error(t('social.err.server', { status: 500 }))
|
||||
return c
|
||||
}
|
||||
|
||||
export async function deleteReviewComment(id: number): Promise<void> {
|
||||
await rpc('delete_review_comment', { p_id: id })
|
||||
}
|
||||
@@ -5,7 +5,15 @@ import { safeMediaUrl } from './social'
|
||||
|
||||
/** Notifications (cloche) : abonnements, demandes acceptées, réactions reçues. */
|
||||
|
||||
export type NotificationKind = 'follow_request' | 'follow_accepted' | 'new_follower' | 'reaction' | 'new_episode' | 'new_season'
|
||||
export type NotificationKind =
|
||||
| 'follow_request'
|
||||
| 'follow_accepted'
|
||||
| 'new_follower'
|
||||
| 'reaction'
|
||||
| 'new_episode'
|
||||
| 'new_season'
|
||||
| 'review_comment'
|
||||
| 'shared_list_invite'
|
||||
|
||||
export interface AppNotification {
|
||||
id: number
|
||||
@@ -19,8 +27,10 @@ export interface AppNotification {
|
||||
/** Nombre de nouveaux épisodes (épisodes) */
|
||||
ep_count: number | null
|
||||
actor: { username: string; display_name: string; avatar_url: string | null } | null
|
||||
/** Titre de la fiche concernée (réactions, épisodes) */
|
||||
/** Titre de la fiche concernée (réactions, commentaires, épisodes) ou nom de la liste partagée */
|
||||
title: string | null
|
||||
/** Invitation à une liste partagée : en attente, acceptée, ou plus valable (null) */
|
||||
invite_status: 'pending' | 'accepted' | null
|
||||
}
|
||||
|
||||
/** Épisode/saison à signaler (envoyé après la vérification des sorties). */
|
||||
@@ -54,7 +64,7 @@ async function rpc<T>(name: string, args: Record<string, unknown> = {}): Promise
|
||||
return res.json() as Promise<T>
|
||||
}
|
||||
|
||||
const KINDS: NotificationKind[] = ['follow_request', 'follow_accepted', 'new_follower', 'reaction', 'new_episode', 'new_season']
|
||||
const KINDS: NotificationKind[] = ['follow_request', 'follow_accepted', 'new_follower', 'reaction', 'new_episode', 'new_season', 'review_comment', 'shared_list_invite']
|
||||
const num = (v: unknown) => (typeof v === 'number' && Number.isFinite(v) ? v : null)
|
||||
|
||||
/** Réponse du serveur relue champ par champ (adresses d'images comprises), comme pour les profils. */
|
||||
@@ -75,6 +85,7 @@ function toNotification(v: unknown): AppNotification | null {
|
||||
ep_count: num(v.ep_count),
|
||||
actor: username ? { username, display_name: cleanText(a!.display_name, 40) ?? username, avatar_url: safeMediaUrl(a!.avatar_url) ?? null } : null,
|
||||
title: cleanText(v.title, 300) ?? null,
|
||||
invite_status: v.invite_status === 'pending' || v.invite_status === 'accepted' ? v.invite_status : null,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ export interface TitleReview {
|
||||
updated_at: string
|
||||
rating: number | null
|
||||
notes: string
|
||||
/** L'auteur a signalé des spoilers : texte masqué jusqu'au tap */
|
||||
spoiler: boolean
|
||||
/** Nombre de commentaires sous l'avis (null : serveur sans les commentaires) */
|
||||
comments: number | null
|
||||
/** emoji -> nombre */
|
||||
reactions: Record<string, number>
|
||||
total: number
|
||||
@@ -76,6 +80,8 @@ function toReview(v: unknown): TitleReview | null {
|
||||
updated_at: safeIso(v.updated_at) ?? new Date(0).toISOString(),
|
||||
rating: typeof v.rating === 'number' && v.rating > 0 && v.rating <= 10 ? v.rating : null,
|
||||
notes,
|
||||
spoiler: v.spoiler === true,
|
||||
comments: typeof v.comments === 'number' && Number.isFinite(v.comments) ? Math.min(Math.max(0, Math.floor(v.comments)), 100000) : null,
|
||||
reactions,
|
||||
total: Object.values(reactions).reduce((a, b) => a + b, 0),
|
||||
mine: (REACTION_EMOJIS as readonly string[]).includes(v.mine as string) ? (v.mine as string) : null,
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
import { t } from '../../i18n'
|
||||
import type { MediaItem, MediaType } from '../../types'
|
||||
import { cleanText, isPlainObject, isSafeExternalId, remoteImage, safeIso } from '../security'
|
||||
import { cloudFetch } from './api'
|
||||
import { safeMediaUrl, type ProfileCard } from './social'
|
||||
|
||||
/**
|
||||
* Listes partagées / collaboratives (côté serveur, réservées aux membres).
|
||||
* Différentes des listes perso (privées, synchronisées avec la bibliothèque) : un titre y est un
|
||||
* simple instantané (référence TMDB/AniList, titre, affiche, type, année) ajouté par un membre.
|
||||
* Tout passe par les fonctions de la base, qui vérifient l'appartenance à chaque appel.
|
||||
*/
|
||||
|
||||
export interface MiniUser {
|
||||
id: string
|
||||
username: string
|
||||
displayName: string
|
||||
avatarUrl?: string
|
||||
}
|
||||
|
||||
export interface SharedListCard {
|
||||
id: string
|
||||
name: string
|
||||
isOwner: boolean
|
||||
owner: MiniUser | null
|
||||
count: number
|
||||
members: number
|
||||
posters: string[]
|
||||
/** Le titre demandé (p_external_id) est déjà dans la liste */
|
||||
has: boolean
|
||||
}
|
||||
|
||||
export interface SharedListInvite {
|
||||
id: string
|
||||
name: string
|
||||
owner: MiniUser | null
|
||||
members: number
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface SharedListMember extends MiniUser {
|
||||
status: 'pending' | 'accepted'
|
||||
isOwner: boolean
|
||||
}
|
||||
|
||||
export interface SharedListItem {
|
||||
externalId: string
|
||||
title: string
|
||||
poster?: string
|
||||
type: MediaType
|
||||
year?: number
|
||||
addedAt: string
|
||||
addedBy: MiniUser | null
|
||||
}
|
||||
|
||||
export interface SharedList {
|
||||
id: string
|
||||
name: string
|
||||
isOwner: boolean
|
||||
members: SharedListMember[]
|
||||
items: SharedListItem[]
|
||||
}
|
||||
|
||||
/** Les tables / fonctions n'existent pas encore côté serveur : la fonctionnalité se masque. */
|
||||
export class SharedListsUnavailable extends Error {}
|
||||
|
||||
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
|
||||
const USERNAME = /^[a-z0-9_]{3,20}$/
|
||||
const TYPES = new Set<MediaType>(['film', 'serie', 'anime', 'kdrama', 'cdrama', 'autre'])
|
||||
export const SHARED_LIST_NAME_MAX = 80
|
||||
|
||||
async function rpc(name: string, args: Record<string, unknown> = {}): Promise<unknown> {
|
||||
const res = await cloudFetch(`/rest/v1/rpc/${name}`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(args),
|
||||
})
|
||||
if (res.ok) return res.json()
|
||||
if (res.status === 404) throw new SharedListsUnavailable(t('shared.unavailable'))
|
||||
const body = (await res.json().catch(() => ({}))) as { message?: string }
|
||||
const msg = typeof body.message === 'string' ? body.message : ''
|
||||
if (msg.includes('rate limit')) throw new Error(t('shared.err.rate'))
|
||||
if (msg.includes('too many members')) throw new Error(t('shared.err.members'))
|
||||
if (msg.includes('too many lists')) throw new Error(t('shared.err.lists'))
|
||||
if (msg.includes('list full')) throw new Error(t('shared.err.full'))
|
||||
if (msg.includes('not connected')) throw new Error(t('shared.err.notConnected'))
|
||||
if (msg.includes('forbidden') || msg.includes('invite not found')) throw new Error(t('shared.err.forbidden'))
|
||||
throw new Error(t('social.err.server', { status: res.status }))
|
||||
}
|
||||
|
||||
function toUser(v: unknown): MiniUser | null {
|
||||
if (!isPlainObject(v) || typeof v.id !== 'string' || !UUID.test(v.id) || typeof v.username !== 'string' || !USERNAME.test(v.username)) return null
|
||||
return { id: v.id, username: v.username, displayName: cleanText(v.display_name, 40) ?? v.username, avatarUrl: safeMediaUrl(v.avatar_url) }
|
||||
}
|
||||
|
||||
const count = (v: unknown) => (typeof v === 'number' && Number.isFinite(v) && v > 0 ? Math.min(Math.floor(v), 100000) : 0)
|
||||
const listId = (v: unknown) => (typeof v === 'string' && UUID.test(v) ? v : null)
|
||||
|
||||
function toCard(v: unknown): SharedListCard | null {
|
||||
if (!isPlainObject(v)) return null
|
||||
const id = listId(v.id)
|
||||
const name = cleanText(v.name, SHARED_LIST_NAME_MAX)
|
||||
if (!id || !name) return null
|
||||
return {
|
||||
id,
|
||||
name,
|
||||
isOwner: v.is_owner === true,
|
||||
owner: toUser(v.owner),
|
||||
count: count(v.count),
|
||||
members: count(v.members),
|
||||
posters: (Array.isArray(v.posters) ? v.posters.slice(0, 4) : []).map(remoteImage).filter((p): p is string => !!p),
|
||||
has: v.has === true,
|
||||
}
|
||||
}
|
||||
|
||||
function toInvite(v: unknown): SharedListInvite | null {
|
||||
if (!isPlainObject(v)) return null
|
||||
const id = listId(v.id)
|
||||
const name = cleanText(v.name, SHARED_LIST_NAME_MAX)
|
||||
if (!id || !name) return null
|
||||
return { id, name, owner: toUser(v.owner), members: count(v.members), createdAt: safeIso(v.created_at) ?? new Date(0).toISOString() }
|
||||
}
|
||||
|
||||
function toItem(v: unknown): SharedListItem | null {
|
||||
if (!isPlainObject(v) || !isSafeExternalId(v.external_id)) return null
|
||||
const title = cleanText(v.title, 300)
|
||||
if (!title) return null
|
||||
const year = typeof v.year === 'number' && Number.isInteger(v.year) && v.year >= 1870 && v.year <= 2200 ? v.year : undefined
|
||||
return {
|
||||
externalId: v.external_id,
|
||||
title,
|
||||
poster: remoteImage(v.poster),
|
||||
type: TYPES.has(v.type as MediaType) ? (v.type as MediaType) : 'autre',
|
||||
year,
|
||||
addedAt: safeIso(v.added_at) ?? new Date(0).toISOString(),
|
||||
addedBy: toUser(v.added_by),
|
||||
}
|
||||
}
|
||||
|
||||
function toMember(v: unknown): SharedListMember | null {
|
||||
const u = toUser(v)
|
||||
if (!u || !isPlainObject(v)) return null
|
||||
return { ...u, status: v.status === 'accepted' ? 'accepted' : 'pending', isOwner: v.is_owner === true }
|
||||
}
|
||||
|
||||
const list = <T>(v: unknown, map: (x: unknown) => T | null, max = 500): T[] => (Array.isArray(v) ? v.slice(0, max) : []).map(map).filter((x): x is T => x !== null)
|
||||
|
||||
// ─── Lecture ───
|
||||
|
||||
export async function getSharedLists(externalId?: string): Promise<{ lists: SharedListCard[]; invites: SharedListInvite[] }> {
|
||||
const raw = await rpc('get_shared_lists', { p_external_id: externalId && isSafeExternalId(externalId) ? externalId : null })
|
||||
if (!isPlainObject(raw)) return { lists: [], invites: [] }
|
||||
return { lists: list(raw.lists, toCard, 200), invites: list(raw.invites, toInvite, 100) }
|
||||
}
|
||||
|
||||
export async function getSharedList(id: string): Promise<SharedList | null> {
|
||||
if (!UUID.test(id)) return null
|
||||
const raw = await rpc('get_shared_list', { p_list: id })
|
||||
if (!isPlainObject(raw)) return null
|
||||
const name = cleanText(raw.name, SHARED_LIST_NAME_MAX)
|
||||
if (!name) return null
|
||||
return { id, name, isOwner: raw.is_owner === true, members: list(raw.members, toMember, 50), items: list(raw.items, toItem, 500) }
|
||||
}
|
||||
|
||||
/** Personnes invitables (abonnés / abonnements), filtrées par pseudo ou nom. */
|
||||
export async function inviteCandidates(id: string, q: string): Promise<ProfileCard[]> {
|
||||
if (!UUID.test(id)) return []
|
||||
const raw = await rpc('shared_list_candidates', { p_list: id, p_q: q.trim().slice(0, 40) })
|
||||
return list(raw, (v) => {
|
||||
const u = toUser(v)
|
||||
return u && isPlainObject(v) ? { ...u, isPrivate: v.is_private === true, relation: 'none' as const } : null
|
||||
}, 50)
|
||||
}
|
||||
|
||||
// ─── Écriture ───
|
||||
|
||||
export async function createSharedList(name: string): Promise<string> {
|
||||
const raw = await rpc('create_shared_list', { p_name: name.trim().slice(0, SHARED_LIST_NAME_MAX) })
|
||||
const id = isPlainObject(raw) ? listId(raw.id) : null
|
||||
if (!id) throw new Error(t('social.err.server', { status: 500 }))
|
||||
return id
|
||||
}
|
||||
|
||||
export const renameSharedList = (id: string, name: string) => rpc('rename_shared_list', { p_list: id, p_name: name.trim().slice(0, SHARED_LIST_NAME_MAX) })
|
||||
export const deleteSharedList = (id: string) => rpc('delete_shared_list', { p_list: id })
|
||||
export const inviteToSharedList = (id: string, userId: string) => rpc('invite_to_shared_list', { p_list: id, p_user: userId })
|
||||
export const respondToInvite = (id: string, accept: boolean) => rpc('respond_shared_list_invite', { p_list: id, p_accept: accept })
|
||||
export const leaveSharedList = (id: string) => rpc('leave_shared_list', { p_list: id })
|
||||
export const removeSharedListMember = (id: string, userId: string) => rpc('remove_shared_list_member', { p_list: id, p_user: userId })
|
||||
export const removeSharedListItem = (id: string, externalId: string) => rpc('remove_shared_list_item', { p_list: id, p_external_id: externalId })
|
||||
|
||||
/** Instantané minimal d'un titre (jamais d'image embarquée : seulement une adresse TMDB/AniList). */
|
||||
export interface TitleSnapshot {
|
||||
externalId: string
|
||||
title: string
|
||||
poster?: string
|
||||
type: MediaType
|
||||
year?: number
|
||||
}
|
||||
|
||||
export function snapshotOf(item: Pick<MediaItem, 'externalId' | 'title' | 'poster' | 'type' | 'year'>, posterFallback?: string): TitleSnapshot | null {
|
||||
if (!isSafeExternalId(item.externalId)) return null
|
||||
return { externalId: item.externalId, title: item.title, poster: remoteImage(item.poster) ?? remoteImage(posterFallback), type: item.type, year: item.year }
|
||||
}
|
||||
|
||||
export const addSharedListItem = (id: string, s: TitleSnapshot) =>
|
||||
rpc('add_shared_list_item', {
|
||||
p_list: id,
|
||||
p_item: { external_id: s.externalId, title: s.title.slice(0, 300), poster: s.poster ?? null, type: s.type, year: s.year ?? null },
|
||||
})
|
||||
@@ -25,6 +25,8 @@ const NOTIF_PREFS: { key: keyof NotifPrefs; readonly label: () => string }[] = [
|
||||
{ key: 'follows', label: () => t('settings.notifFollows') },
|
||||
{ key: 'accepted', label: () => t('settings.notifAccepted') },
|
||||
{ key: 'reactions', label: () => t('settings.notifReactions') },
|
||||
{ key: 'comments', label: () => t('settings.notifComments') },
|
||||
{ key: 'lists', label: () => t('settings.notifLists') },
|
||||
]
|
||||
|
||||
function Row({ icon, title, hint, onClick, danger }: { icon: ReactNode; title: string; hint?: string; onClick: () => void; danger?: boolean }) {
|
||||
|
||||
@@ -37,6 +37,8 @@ export interface MediaItem {
|
||||
platform?: string
|
||||
/** Mon avis (visible sur mon profil, comme ma note) */
|
||||
notes?: string
|
||||
/** Mon avis contient des spoilers : masqué chez les autres jusqu'au tap */
|
||||
notesSpoiler?: boolean
|
||||
/** URL d'image ou image compressée en data URL (reste locale). */
|
||||
poster?: string
|
||||
/** Grande image horizontale (TMDB), pour l'en-tête de la fiche et l'accueil. */
|
||||
@@ -100,6 +102,10 @@ export interface NotifPrefs {
|
||||
accepted?: boolean
|
||||
/** Réactions reçues sur mes avis */
|
||||
reactions?: boolean
|
||||
/** Commentaires reçus sous mes avis */
|
||||
comments?: boolean
|
||||
/** Invitations à des listes partagées */
|
||||
lists?: boolean
|
||||
}
|
||||
|
||||
export interface CustomList {
|
||||
|
||||
@@ -0,0 +1,233 @@
|
||||
-- ════════════════════════════════════════════════════════════════════════════
|
||||
-- AzuuCine — Avis : spoilers et commentaires (9 octobre 2026)
|
||||
-- 1. Spoilers : l'avis peut être marqué « contient des spoilers ». Le drapeau vit dans la
|
||||
-- fiche synchronisée (items.data->'notesSpoiler', comme l'avis lui-même) ; title_reviews
|
||||
-- le renvoie pour que l'app masque le texte jusqu'au tap.
|
||||
-- 2. Commentaires sous les avis (≤ 500 caractères) : visibles par ceux qui voient l'avis
|
||||
-- (can_view sur l'auteur de l'avis, comptes suspendus exclus), anti-spam (10/minute),
|
||||
-- suppression par l'auteur du commentaire, l'auteur de l'avis ou un admin.
|
||||
-- Notification « review_comment » à l'auteur de l'avis (préférence notifPrefs.comments).
|
||||
-- 3. Nouveaux types de notification : review_comment, shared_list_invite (listes partagées,
|
||||
-- voir …130100_shared_lists.sql) + préférences notifPrefs.comments / notifPrefs.lists.
|
||||
--
|
||||
-- À coller dans Supabase → SQL Editor → Run, APRÈS …20261007120000_social_notifications.sql.
|
||||
-- Idempotent (réexécutable sans risque).
|
||||
-- ════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
-- ── Nouveaux types de notification ──
|
||||
alter table public.notifications drop constraint if exists notifications_kind_check;
|
||||
alter table public.notifications add constraint notifications_kind_check
|
||||
check (kind in ('follow_request','follow_accepted','new_follower','reaction','new_episode','new_season',
|
||||
'review_comment','shared_list_invite'));
|
||||
|
||||
-- Préférences (oui par défaut) : settings.data.notifPrefs = { episodes, follows, accepted, reactions, comments, lists }
|
||||
create or replace function public.azuu_wants(p_user uuid, p_kind text)
|
||||
returns boolean language sql stable security definer set search_path = '' as $$
|
||||
select coalesce((
|
||||
select (s.data->'notifPrefs'->>(case p_kind
|
||||
when 'follow_request' then 'follows'
|
||||
when 'new_follower' then 'follows'
|
||||
when 'follow_accepted' then 'accepted'
|
||||
when 'reaction' then 'reactions'
|
||||
when 'review_comment' then 'comments'
|
||||
when 'shared_list_invite' then 'lists'
|
||||
else 'episodes' end)) is distinct from 'false'
|
||||
from public.settings s where s.user_id = p_user
|
||||
), true)
|
||||
$$;
|
||||
revoke all on function public.azuu_wants(uuid, text) from public, anon, authenticated;
|
||||
|
||||
-- ── Commentaires ──
|
||||
create table if not exists public.review_comments (
|
||||
id bigint generated always as identity primary key,
|
||||
author_id uuid not null references auth.users(id) on delete cascade, -- auteur de l'avis
|
||||
item_id text not null check (item_id ~ '^[A-Za-z0-9_-]{1,64}$'), -- fiche de l'auteur
|
||||
user_id uuid not null default auth.uid() references auth.users(id) on delete cascade, -- qui commente
|
||||
body text not null check (char_length(body) between 1 and 500),
|
||||
created_at timestamptz not null default now()
|
||||
);
|
||||
create index if not exists review_comments_target_idx on public.review_comments (author_id, item_id, created_at);
|
||||
create index if not exists review_comments_user_idx on public.review_comments (user_id, created_at desc);
|
||||
alter table public.review_comments enable row level security;
|
||||
alter table public.review_comments force row level security;
|
||||
-- Aucun accès direct : tout passe par les fonctions ci-dessous (qui vérifient les droits)
|
||||
revoke all on public.review_comments from public, anon, authenticated;
|
||||
|
||||
-- L'avis (auteur, fiche) existe-t-il et suis-je autorisé à le voir ?
|
||||
create or replace function public.azuu_review_visible(p_author uuid, p_item text)
|
||||
returns boolean language sql stable security definer set search_path = '' as $$
|
||||
select auth.uid() is not null
|
||||
and p_author is not null and p_item is not null
|
||||
and public.can_view(p_author)
|
||||
and exists (
|
||||
select 1 from public.items i join public.profiles pr on pr.id = i.user_id
|
||||
where i.user_id = p_author and i.id = p_item and not i.deleted
|
||||
and coalesce(i.data->>'notes', '') <> ''
|
||||
and (not pr.suspended or p_author = auth.uid())
|
||||
)
|
||||
$$;
|
||||
revoke all on function public.azuu_review_visible(uuid, text) from public, anon, authenticated;
|
||||
|
||||
-- Fil de commentaires d'un avis (200 derniers, du plus ancien au plus récent)
|
||||
create or replace function public.get_review_comments(p_author uuid, p_item text)
|
||||
returns jsonb language plpgsql stable security definer set search_path = '' as $$
|
||||
declare
|
||||
me uuid := auth.uid();
|
||||
moderator boolean;
|
||||
begin
|
||||
if not public.azuu_review_visible(p_author, p_item) then
|
||||
return jsonb_build_object('visible', false, 'can_moderate', false, 'comments', '[]'::jsonb);
|
||||
end if;
|
||||
moderator := p_author = me or public.is_admin();
|
||||
return jsonb_build_object(
|
||||
'visible', true,
|
||||
'can_moderate', moderator,
|
||||
'comments', coalesce((
|
||||
select jsonb_agg(jsonb_build_object(
|
||||
'id', c.id, 'body', c.body, 'created_at', c.created_at,
|
||||
'user', jsonb_build_object('id', p.id, 'username', p.username, 'display_name', p.display_name, 'avatar_url', p.avatar_url),
|
||||
'mine', c.user_id = me,
|
||||
'can_delete', moderator or c.user_id = me
|
||||
) order by c.created_at, c.id)
|
||||
from (
|
||||
select * from public.review_comments rc
|
||||
where rc.author_id = p_author and rc.item_id = p_item
|
||||
order by rc.created_at desc, rc.id desc
|
||||
limit 200
|
||||
) c
|
||||
join public.profiles p on p.id = c.user_id
|
||||
where not p.suspended or c.user_id = me
|
||||
), '[]'::jsonb)
|
||||
);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- Écrire un commentaire (renvoie le commentaire créé)
|
||||
create or replace function public.add_review_comment(p_author uuid, p_item text, p_body text)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
declare
|
||||
me uuid := auth.uid();
|
||||
b text;
|
||||
c public.review_comments;
|
||||
p public.profiles;
|
||||
begin
|
||||
if me is null then raise exception 'auth'; end if;
|
||||
if not public.azuu_review_visible(p_author, p_item) then raise exception 'review not found'; end if;
|
||||
select * into p from public.profiles where id = me;
|
||||
if not found or p.suspended then raise exception 'forbidden'; end if;
|
||||
-- Caractères de contrôle retirés (sauf retours à la ligne), pas plus de 2 lignes vides d'affilée
|
||||
b := regexp_replace(coalesce(p_body, ''), '\r\n?', E'\n', 'g');
|
||||
b := regexp_replace(b, '[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]', '', 'g');
|
||||
b := regexp_replace(b, '\n{3,}', E'\n\n', 'g');
|
||||
b := regexp_replace(b, '^\s+|\s+$', '', 'g'); -- espaces ET retours à la ligne en début / fin
|
||||
if char_length(b) < 1 or char_length(b) > 500 then raise exception 'invalid comment'; end if;
|
||||
-- Anti-spam : 10 commentaires par minute, 300 par jour
|
||||
if (select count(*) from public.review_comments where user_id = me and created_at > now() - interval '1 minute') >= 10
|
||||
or (select count(*) from public.review_comments where user_id = me and created_at > now() - interval '1 day') >= 300 then
|
||||
raise exception 'rate limit';
|
||||
end if;
|
||||
if (select count(*) from public.review_comments where author_id = p_author and item_id = p_item) >= 1000 then
|
||||
raise exception 'too many comments';
|
||||
end if;
|
||||
insert into public.review_comments (author_id, item_id, user_id, body)
|
||||
values (p_author, p_item, me, b)
|
||||
returning * into c;
|
||||
-- Notifie l'auteur de l'avis (jamais soi-même ; selon ses préférences)
|
||||
perform public.azuu_notify(p_author, 'review_comment', me, p_item, null);
|
||||
return jsonb_build_object(
|
||||
'id', c.id, 'body', c.body, 'created_at', c.created_at,
|
||||
'user', jsonb_build_object('id', p.id, 'username', p.username, 'display_name', p.display_name, 'avatar_url', p.avatar_url),
|
||||
'mine', true, 'can_delete', true
|
||||
);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- Supprimer un commentaire : le sien, ceux sous son avis, ou tout (admin)
|
||||
create or replace function public.delete_review_comment(p_id bigint)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
declare
|
||||
me uuid := auth.uid();
|
||||
n integer;
|
||||
begin
|
||||
if me is null then raise exception 'auth'; end if;
|
||||
delete from public.review_comments c
|
||||
where c.id = p_id and (c.user_id = me or c.author_id = me or public.is_admin());
|
||||
get diagnostics n = row_count;
|
||||
return jsonb_build_object('ok', n > 0);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- Avis effacé (texte vidé, fiche supprimée, modération) : ses commentaires partent avec lui
|
||||
create or replace function public.azuu_review_cleanup()
|
||||
returns trigger language plpgsql security definer set search_path = '' as $$
|
||||
begin
|
||||
delete from public.review_comments where author_id = new.user_id and item_id = new.id;
|
||||
return null;
|
||||
end;
|
||||
$$;
|
||||
drop trigger if exists items_review_cleanup on public.items;
|
||||
create trigger items_review_cleanup after update on public.items
|
||||
for each row
|
||||
when (coalesce(old.data->>'notes', '') <> '' and (new.deleted or coalesce(new.data->>'notes', '') = ''))
|
||||
execute function public.azuu_review_cleanup();
|
||||
|
||||
-- ── Tous les avis sur un titre : + drapeau spoiler et nombre de commentaires ──
|
||||
create or replace function public.title_reviews(p_external_id text, p_offset integer default 0)
|
||||
returns jsonb language plpgsql stable security definer set search_path = '' as $$
|
||||
declare me uuid := auth.uid(); res jsonb;
|
||||
begin
|
||||
if me is null or p_external_id !~ '^(tmdb:(movie|tv):[0-9]{1,10}|anilist:[0-9]{1,10})$' then
|
||||
return jsonb_build_object('friends', '[]'::jsonb, 'others', '[]'::jsonb);
|
||||
end if;
|
||||
with revs as (
|
||||
select i.user_id, i.id as item_id, i.updated_at,
|
||||
nullif(i.data->>'rating','')::numeric as rating,
|
||||
i.data->>'notes' as notes,
|
||||
coalesce(i.data->>'notesSpoiler', '') = 'true' as spoiler,
|
||||
pr,
|
||||
exists(select 1 from public.follows f where f.follower_id = me and f.following_id = i.user_id and f.status = 'accepted') as friend
|
||||
from public.items i
|
||||
join public.profiles pr on pr.id = i.user_id
|
||||
where i.data->>'externalId' = p_external_id
|
||||
and not i.deleted and coalesce(i.data->>'notes','') <> ''
|
||||
and i.user_id <> me and not pr.suspended
|
||||
and (not pr.is_private
|
||||
or exists(select 1 from public.follows f where f.follower_id = me and f.following_id = i.user_id and f.status = 'accepted'))
|
||||
),
|
||||
enriched as (
|
||||
select r.*,
|
||||
(select coalesce(jsonb_object_agg(e.emoji, e.c), '{}'::jsonb)
|
||||
from (select emoji, count(*) c from public.review_reactions rr
|
||||
where rr.author_id = r.user_id and rr.item_id = r.item_id group by emoji) e) as reactions,
|
||||
(select count(*) from public.review_reactions rr where rr.author_id = r.user_id and rr.item_id = r.item_id) as total,
|
||||
(select emoji from public.review_reactions rr where rr.author_id = r.user_id and rr.item_id = r.item_id and rr.user_id = me) as mine,
|
||||
(select count(*) from public.review_comments rc join public.profiles cp on cp.id = rc.user_id
|
||||
where rc.author_id = r.user_id and rc.item_id = r.item_id and (not cp.suspended or rc.user_id = me)) as comments
|
||||
from revs r
|
||||
)
|
||||
select jsonb_build_object(
|
||||
'friends', coalesce((select jsonb_agg(entry order by total desc, updated_at desc) from (
|
||||
select jsonb_build_object('user', public.profile_card(pr), 'user_id', user_id, 'item_id', item_id,
|
||||
'updated_at', updated_at, 'rating', rating, 'notes', notes, 'spoiler', spoiler,
|
||||
'reactions', reactions, 'total', total, 'mine', mine, 'comments', comments) entry, total, updated_at
|
||||
from enriched where friend offset greatest(p_offset, 0) limit 40) f), '[]'::jsonb),
|
||||
'others', coalesce((select jsonb_agg(entry order by total desc, updated_at desc) from (
|
||||
select jsonb_build_object('user', public.profile_card(pr), 'user_id', user_id, 'item_id', item_id,
|
||||
'updated_at', updated_at, 'rating', rating, 'notes', notes, 'spoiler', spoiler,
|
||||
'reactions', reactions, 'total', total, 'mine', mine, 'comments', comments) entry, total, updated_at
|
||||
from enriched where not friend offset greatest(p_offset, 0) limit 40) o), '[]'::jsonb)
|
||||
) into res;
|
||||
return res;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- ── Droits (gate interne : auth.uid() / can_view / is_admin) ──
|
||||
revoke all on function public.azuu_review_cleanup() from public, anon, authenticated;
|
||||
revoke all on function public.get_review_comments(uuid, text) from public, anon;
|
||||
revoke all on function public.add_review_comment(uuid, text, text) from public, anon;
|
||||
revoke all on function public.delete_review_comment(bigint) from public, anon;
|
||||
revoke all on function public.title_reviews(text, integer) from public, anon;
|
||||
grant execute on function public.get_review_comments(uuid, text) to authenticated;
|
||||
grant execute on function public.add_review_comment(uuid, text, text) to authenticated;
|
||||
grant execute on function public.delete_review_comment(bigint) to authenticated;
|
||||
grant execute on function public.title_reviews(text, integer) to authenticated;
|
||||
@@ -0,0 +1,418 @@
|
||||
-- ════════════════════════════════════════════════════════════════════════════
|
||||
-- AzuuCine — Listes partagées / collaboratives (9 octobre 2026)
|
||||
-- - Le propriétaire crée une liste et invite des membres (parmi ceux qu'il suit ou qui le suivent).
|
||||
-- - Invitation = notification « shared_list_invite » ; le membre doit accepter.
|
||||
-- - Chaque membre ajoute / retire des titres (instantané minimal : référence TMDB/AniList, titre,
|
||||
-- affiche, type, année) et voit qui a ajouté quoi. On peut quitter une liste ; le propriétaire
|
||||
-- peut retirer un membre, renommer ou supprimer la liste.
|
||||
-- - Les listes perso (public.lists) ne changent pas : elles restent privées.
|
||||
--
|
||||
-- Sécurité : RLS activé, AUCUN accès direct aux tables ; tout passe par des fonctions
|
||||
-- security definer qui vérifient l'appartenance (seuls les membres lisent / écrivent).
|
||||
--
|
||||
-- À coller dans Supabase → SQL Editor → Run, APRÈS …20261009130000_review_spoilers_comments.sql.
|
||||
-- Idempotent (réexécutable sans risque).
|
||||
-- ════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
-- ── Tables ──
|
||||
create table if not exists public.shared_lists (
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
owner_id uuid not null default auth.uid() references auth.users(id) on delete cascade,
|
||||
name text not null check (char_length(name) between 1 and 80),
|
||||
created_at timestamptz not null default now(),
|
||||
updated_at timestamptz not null default now()
|
||||
);
|
||||
create index if not exists shared_lists_owner_idx on public.shared_lists (owner_id, created_at desc);
|
||||
|
||||
-- Le propriétaire est aussi membre (status 'accepted') : une seule règle d'appartenance.
|
||||
create table if not exists public.shared_list_members (
|
||||
list_id uuid not null references public.shared_lists(id) on delete cascade,
|
||||
user_id uuid not null references auth.users(id) on delete cascade,
|
||||
status text not null default 'pending' check (status in ('pending', 'accepted')),
|
||||
-- Qui a invité : gardé en « set null » pour que la liste survive à la suppression d'un compte
|
||||
invited_by uuid references auth.users(id) on delete set null,
|
||||
created_at timestamptz not null default now(),
|
||||
primary key (list_id, user_id)
|
||||
);
|
||||
create index if not exists shared_list_members_user_idx on public.shared_list_members (user_id, status);
|
||||
create index if not exists shared_list_members_inviter_idx on public.shared_list_members (invited_by, created_at desc);
|
||||
|
||||
create table if not exists public.shared_list_items (
|
||||
list_id uuid not null references public.shared_lists(id) on delete cascade,
|
||||
external_id text not null check (external_id ~ '^(tmdb:(movie|tv):[0-9]{1,10}|anilist:[0-9]{1,10})$'),
|
||||
title text not null check (char_length(title) between 1 and 300),
|
||||
poster text check (poster is null or (char_length(poster) <= 300
|
||||
and poster ~ '^https://(image\.tmdb\.org|s4\.anilist\.co)/[A-Za-z0-9/_.-]+$')),
|
||||
type text not null check (type in ('film', 'serie', 'anime', 'kdrama', 'cdrama', 'autre')),
|
||||
year integer check (year is null or year between 1870 and 2200),
|
||||
-- Qui l'a ajouté : « set null » à la suppression du compte (le titre reste pour les autres membres)
|
||||
added_by uuid references auth.users(id) on delete set null,
|
||||
added_at timestamptz not null default now(),
|
||||
primary key (list_id, external_id)
|
||||
);
|
||||
create index if not exists shared_list_items_list_idx on public.shared_list_items (list_id, added_at desc);
|
||||
create index if not exists shared_list_items_adder_idx on public.shared_list_items (added_by, added_at desc);
|
||||
|
||||
alter table public.shared_lists enable row level security;
|
||||
alter table public.shared_lists force row level security;
|
||||
alter table public.shared_list_members enable row level security;
|
||||
alter table public.shared_list_members force row level security;
|
||||
alter table public.shared_list_items enable row level security;
|
||||
alter table public.shared_list_items force row level security;
|
||||
revoke all on public.shared_lists, public.shared_list_members, public.shared_list_items from public, anon, authenticated;
|
||||
|
||||
-- ── Outils internes ──
|
||||
-- Suis-je membre (accepté) de cette liste ?
|
||||
create or replace function public.azuu_sl_member(p_list uuid)
|
||||
returns boolean language sql stable security definer set search_path = '' as $$
|
||||
select auth.uid() is not null and exists (
|
||||
select 1 from public.shared_list_members m
|
||||
where m.list_id = p_list and m.user_id = auth.uid() and m.status = 'accepted'
|
||||
)
|
||||
$$;
|
||||
|
||||
create or replace function public.azuu_sl_owner(p_list uuid)
|
||||
returns boolean language sql stable security definer set search_path = '' as $$
|
||||
select auth.uid() is not null and exists (select 1 from public.shared_lists l where l.id = p_list and l.owner_id = auth.uid())
|
||||
$$;
|
||||
|
||||
-- Nom propre : sans caractères de contrôle, espaces superflus retirés
|
||||
create or replace function public.azuu_sl_name(p_name text)
|
||||
returns text language sql immutable set search_path = '' as $$
|
||||
select trim(regexp_replace(regexp_replace(coalesce(p_name, ''), '\s+', ' ', 'g'), '[[:cntrl:]]', '', 'g'))
|
||||
$$;
|
||||
|
||||
create or replace function public.azuu_mini_card(p public.profiles)
|
||||
returns jsonb language sql stable security definer set search_path = '' as $$
|
||||
select case when p.id is null then null else
|
||||
jsonb_build_object('id', p.id, 'username', p.username, 'display_name', p.display_name, 'avatar_url', p.avatar_url) end
|
||||
$$;
|
||||
|
||||
create or replace function public.azuu_me_active()
|
||||
returns boolean language sql stable security definer set search_path = '' as $$
|
||||
select auth.uid() is not null and exists (select 1 from public.profiles p where p.id = auth.uid() and not p.suspended)
|
||||
$$;
|
||||
|
||||
-- ── Lecture ──
|
||||
-- Mes listes partagées (+ invitations en attente). p_external_id : indique si ce titre est déjà dans chaque liste.
|
||||
create or replace function public.get_shared_lists(p_external_id text default null)
|
||||
returns jsonb language plpgsql stable security definer set search_path = '' as $$
|
||||
declare me uuid := auth.uid();
|
||||
begin
|
||||
if me is null then
|
||||
return jsonb_build_object('lists', '[]'::jsonb, 'invites', '[]'::jsonb);
|
||||
end if;
|
||||
return jsonb_build_object(
|
||||
'lists', coalesce((
|
||||
select jsonb_agg(s.entry order by s.updated_at desc)
|
||||
from (
|
||||
select l.updated_at, jsonb_build_object(
|
||||
'id', l.id, 'name', l.name, 'is_owner', l.owner_id = me,
|
||||
'owner', public.azuu_mini_card(op),
|
||||
'count', (select count(*) from public.shared_list_items i where i.list_id = l.id),
|
||||
'members', (select count(*) from public.shared_list_members mm where mm.list_id = l.id and mm.status = 'accepted'),
|
||||
'posters', coalesce((select jsonb_agg(x.poster) from (
|
||||
select i.poster from public.shared_list_items i
|
||||
where i.list_id = l.id and i.poster is not null order by i.added_at desc limit 4) x), '[]'::jsonb),
|
||||
'has', p_external_id is not null and exists (
|
||||
select 1 from public.shared_list_items i where i.list_id = l.id and i.external_id = p_external_id),
|
||||
'updated_at', l.updated_at
|
||||
) as entry
|
||||
from public.shared_list_members m
|
||||
join public.shared_lists l on l.id = m.list_id
|
||||
join public.profiles op on op.id = l.owner_id
|
||||
where m.user_id = me and m.status = 'accepted'
|
||||
limit 200
|
||||
) s
|
||||
), '[]'::jsonb),
|
||||
'invites', coalesce((
|
||||
select jsonb_agg(s.entry order by s.created_at desc)
|
||||
from (
|
||||
select m.created_at, jsonb_build_object(
|
||||
'id', l.id, 'name', l.name,
|
||||
'owner', public.azuu_mini_card(op),
|
||||
'members', (select count(*) from public.shared_list_members mm where mm.list_id = l.id and mm.status = 'accepted'),
|
||||
'created_at', m.created_at
|
||||
) as entry
|
||||
from public.shared_list_members m
|
||||
join public.shared_lists l on l.id = m.list_id
|
||||
join public.profiles op on op.id = l.owner_id
|
||||
where m.user_id = me and m.status = 'pending' and not op.suspended
|
||||
limit 100
|
||||
) s
|
||||
), '[]'::jsonb)
|
||||
);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- Une liste : membres et titres (membres acceptés uniquement)
|
||||
create or replace function public.get_shared_list(p_list uuid)
|
||||
returns jsonb language plpgsql stable security definer set search_path = '' as $$
|
||||
declare
|
||||
me uuid := auth.uid();
|
||||
l public.shared_lists;
|
||||
begin
|
||||
if not public.azuu_sl_member(p_list) then return null; end if;
|
||||
select * into l from public.shared_lists where id = p_list;
|
||||
return jsonb_build_object(
|
||||
'id', l.id, 'name', l.name, 'is_owner', l.owner_id = me, 'owner_id', l.owner_id,
|
||||
'created_at', l.created_at, 'updated_at', l.updated_at,
|
||||
'members', coalesce((
|
||||
select jsonb_agg(public.azuu_mini_card(p) || jsonb_build_object('status', m.status, 'is_owner', m.user_id = l.owner_id)
|
||||
order by (m.user_id = l.owner_id) desc, m.status, m.created_at)
|
||||
from public.shared_list_members m join public.profiles p on p.id = m.user_id
|
||||
where m.list_id = l.id
|
||||
), '[]'::jsonb),
|
||||
'items', coalesce((
|
||||
select jsonb_agg(jsonb_build_object(
|
||||
'external_id', s.external_id, 'title', s.title, 'poster', s.poster, 'type', s.type, 'year', s.year,
|
||||
'added_at', s.added_at, 'added_by', public.azuu_mini_card(p)
|
||||
) order by s.added_at desc)
|
||||
from (select * from public.shared_list_items i where i.list_id = l.id order by i.added_at desc limit 500) s
|
||||
left join public.profiles p on p.id = s.added_by
|
||||
), '[]'::jsonb)
|
||||
);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- Personnes que je peux inviter : abonnés / abonnements acceptés, pas déjà dans la liste
|
||||
create or replace function public.shared_list_candidates(p_list uuid, p_q text default '')
|
||||
returns jsonb language plpgsql stable security definer set search_path = '' as $$
|
||||
declare
|
||||
me uuid := auth.uid();
|
||||
term text := lower(trim(coalesce(p_q, '')));
|
||||
pattern text;
|
||||
begin
|
||||
if not public.azuu_sl_owner(p_list) or char_length(term) > 40 then return '[]'::jsonb; end if;
|
||||
pattern := replace(replace(replace(ltrim(term, '@'), '\', '\\'), '%', '\%'), '_', '\_');
|
||||
return coalesce((
|
||||
select jsonb_agg(public.profile_card(p) order by p.username)
|
||||
from (
|
||||
select pr.* from public.profiles pr
|
||||
where pr.id <> me and not pr.suspended
|
||||
and exists (
|
||||
select 1 from public.follows f where f.status = 'accepted'
|
||||
and ((f.follower_id = me and f.following_id = pr.id) or (f.follower_id = pr.id and f.following_id = me))
|
||||
)
|
||||
and not exists (select 1 from public.shared_list_members m where m.list_id = p_list and m.user_id = pr.id)
|
||||
and (pattern = '' or pr.username like pattern || '%' or lower(pr.display_name) like '%' || pattern || '%')
|
||||
order by pr.username
|
||||
limit 30
|
||||
) p
|
||||
), '[]'::jsonb);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- ── Écriture ──
|
||||
create or replace function public.create_shared_list(p_name text)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
declare
|
||||
me uuid := auth.uid();
|
||||
n text := public.azuu_sl_name(p_name);
|
||||
new_id uuid;
|
||||
begin
|
||||
if not public.azuu_me_active() then raise exception 'forbidden'; end if;
|
||||
if char_length(n) < 1 or char_length(n) > 80 then raise exception 'invalid name'; end if;
|
||||
if (select count(*) from public.shared_lists where owner_id = me) >= 50 then raise exception 'too many lists'; end if;
|
||||
if (select count(*) from public.shared_lists where owner_id = me and created_at > now() - interval '1 minute') >= 5 then
|
||||
raise exception 'rate limit';
|
||||
end if;
|
||||
if (select count(*) from public.shared_list_members where user_id = me and status = 'accepted') >= 100 then
|
||||
raise exception 'too many lists';
|
||||
end if;
|
||||
insert into public.shared_lists (owner_id, name) values (me, n) returning id into new_id;
|
||||
insert into public.shared_list_members (list_id, user_id, status, invited_by) values (new_id, me, 'accepted', me);
|
||||
return jsonb_build_object('id', new_id);
|
||||
end;
|
||||
$$;
|
||||
|
||||
create or replace function public.rename_shared_list(p_list uuid, p_name text)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
declare n text := public.azuu_sl_name(p_name);
|
||||
begin
|
||||
if not public.azuu_sl_owner(p_list) or not public.azuu_me_active() then raise exception 'forbidden'; end if;
|
||||
if char_length(n) < 1 or char_length(n) > 80 then raise exception 'invalid name'; end if;
|
||||
update public.shared_lists set name = n, updated_at = now() where id = p_list;
|
||||
return jsonb_build_object('ok', true);
|
||||
end;
|
||||
$$;
|
||||
|
||||
create or replace function public.delete_shared_list(p_list uuid)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
begin
|
||||
if not (public.azuu_sl_owner(p_list) or public.is_admin()) then raise exception 'forbidden'; end if;
|
||||
delete from public.notifications where kind = 'shared_list_invite' and item_id = p_list::text;
|
||||
delete from public.shared_lists where id = p_list; -- membres et titres : en cascade
|
||||
return jsonb_build_object('ok', true);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- Inviter quelqu'un (propriétaire seulement, parmi ses abonnés / abonnements)
|
||||
create or replace function public.invite_to_shared_list(p_list uuid, p_user uuid)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
declare
|
||||
me uuid := auth.uid();
|
||||
n integer;
|
||||
begin
|
||||
if not public.azuu_sl_owner(p_list) or not public.azuu_me_active() then raise exception 'forbidden'; end if;
|
||||
if p_user is null or p_user = me then raise exception 'invalid user'; end if;
|
||||
if not exists (select 1 from public.profiles p where p.id = p_user and not p.suspended) then raise exception 'profile not found'; end if;
|
||||
if not exists (
|
||||
select 1 from public.follows f where f.status = 'accepted'
|
||||
and ((f.follower_id = me and f.following_id = p_user) or (f.follower_id = p_user and f.following_id = me))
|
||||
) then
|
||||
raise exception 'not connected';
|
||||
end if;
|
||||
if (select count(*) from public.shared_list_members where list_id = p_list) >= 30 then raise exception 'too many members'; end if;
|
||||
if (select count(*) from public.shared_list_members where invited_by = me and user_id <> me and created_at > now() - interval '1 minute') >= 10 then
|
||||
raise exception 'rate limit';
|
||||
end if;
|
||||
insert into public.shared_list_members (list_id, user_id, status, invited_by)
|
||||
values (p_list, p_user, 'pending', me)
|
||||
on conflict (list_id, user_id) do nothing;
|
||||
get diagnostics n = row_count;
|
||||
if n > 0 then
|
||||
perform public.azuu_notify(p_user, 'shared_list_invite', me, p_list::text, null);
|
||||
end if;
|
||||
return jsonb_build_object('ok', true, 'invited', n > 0);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- Accepter / refuser une invitation
|
||||
create or replace function public.respond_shared_list_invite(p_list uuid, p_accept boolean)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
declare me uuid := auth.uid();
|
||||
begin
|
||||
if me is null then raise exception 'auth'; end if;
|
||||
if not exists (select 1 from public.shared_list_members where list_id = p_list and user_id = me and status = 'pending') then
|
||||
raise exception 'invite not found';
|
||||
end if;
|
||||
if p_accept then
|
||||
if not public.azuu_me_active() then raise exception 'forbidden'; end if;
|
||||
if (select count(*) from public.shared_list_members where user_id = me and status = 'accepted') >= 100 then
|
||||
raise exception 'too many lists';
|
||||
end if;
|
||||
update public.shared_list_members set status = 'accepted' where list_id = p_list and user_id = me;
|
||||
else
|
||||
delete from public.shared_list_members where list_id = p_list and user_id = me;
|
||||
delete from public.notifications where user_id = me and kind = 'shared_list_invite' and item_id = p_list::text;
|
||||
end if;
|
||||
return jsonb_build_object('ok', true);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- Quitter une liste (le propriétaire, lui, la supprime)
|
||||
create or replace function public.leave_shared_list(p_list uuid)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
declare me uuid := auth.uid();
|
||||
begin
|
||||
if me is null then raise exception 'auth'; end if;
|
||||
if public.azuu_sl_owner(p_list) then raise exception 'owner cannot leave'; end if;
|
||||
delete from public.shared_list_members where list_id = p_list and user_id = me;
|
||||
delete from public.notifications where user_id = me and kind = 'shared_list_invite' and item_id = p_list::text;
|
||||
return jsonb_build_object('ok', true);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- Retirer un membre (ou annuler une invitation) : propriétaire seulement
|
||||
create or replace function public.remove_shared_list_member(p_list uuid, p_user uuid)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
begin
|
||||
if not public.azuu_sl_owner(p_list) then raise exception 'forbidden'; end if;
|
||||
if p_user = auth.uid() then raise exception 'owner cannot leave'; end if;
|
||||
delete from public.shared_list_members where list_id = p_list and user_id = p_user;
|
||||
delete from public.notifications where user_id = p_user and kind = 'shared_list_invite' and item_id = p_list::text;
|
||||
return jsonb_build_object('ok', true);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- Ajouter un titre : p_item = { external_id, title, poster?, type, year? }
|
||||
create or replace function public.add_shared_list_item(p_list uuid, p_item jsonb)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
declare
|
||||
me uuid := auth.uid();
|
||||
ext text := p_item->>'external_id';
|
||||
ttl text := left(public.azuu_sl_name(p_item->>'title'), 300);
|
||||
pst text := nullif(p_item->>'poster', '');
|
||||
typ text := coalesce(p_item->>'type', 'autre');
|
||||
yr integer;
|
||||
n integer;
|
||||
begin
|
||||
if not public.azuu_sl_member(p_list) or not public.azuu_me_active() then raise exception 'forbidden'; end if;
|
||||
if jsonb_typeof(p_item) is distinct from 'object' then raise exception 'invalid item'; end if;
|
||||
if ext is null or ext !~ '^(tmdb:(movie|tv):[0-9]{1,10}|anilist:[0-9]{1,10})$' or char_length(ttl) < 1 then
|
||||
raise exception 'invalid item';
|
||||
end if;
|
||||
if typ not in ('film', 'serie', 'anime', 'kdrama', 'cdrama', 'autre') then typ := 'autre'; end if;
|
||||
if pst is not null and (char_length(pst) > 300 or pst !~ '^https://(image\.tmdb\.org|s4\.anilist\.co)/[A-Za-z0-9/_.-]+$') then
|
||||
pst := null;
|
||||
end if;
|
||||
if coalesce(p_item->>'year', '') ~ '^[0-9]{4}$' and (p_item->>'year')::int between 1870 and 2200 then
|
||||
yr := (p_item->>'year')::int;
|
||||
end if;
|
||||
if (select count(*) from public.shared_list_items where list_id = p_list) >= 500 then raise exception 'list full'; end if;
|
||||
if (select count(*) from public.shared_list_items where added_by = me and added_at > now() - interval '1 minute') >= 30 then
|
||||
raise exception 'rate limit';
|
||||
end if;
|
||||
insert into public.shared_list_items (list_id, external_id, title, poster, type, year, added_by)
|
||||
values (p_list, ext, ttl, pst, typ, yr, me)
|
||||
on conflict (list_id, external_id) do nothing;
|
||||
get diagnostics n = row_count;
|
||||
if n > 0 then update public.shared_lists set updated_at = now() where id = p_list; end if;
|
||||
return jsonb_build_object('ok', true, 'added', n > 0);
|
||||
end;
|
||||
$$;
|
||||
|
||||
create or replace function public.remove_shared_list_item(p_list uuid, p_external_id text)
|
||||
returns jsonb language plpgsql security definer set search_path = '' as $$
|
||||
declare n integer;
|
||||
begin
|
||||
if not public.azuu_sl_member(p_list) or not public.azuu_me_active() then raise exception 'forbidden'; end if;
|
||||
delete from public.shared_list_items where list_id = p_list and external_id = p_external_id;
|
||||
get diagnostics n = row_count;
|
||||
if n > 0 then update public.shared_lists set updated_at = now() where id = p_list; end if;
|
||||
return jsonb_build_object('ok', true, 'removed', n > 0);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- ── Notifications : titres des nouveaux types + état de l'invitation ──
|
||||
create or replace function public.get_notifications(p_offset integer default 0)
|
||||
returns jsonb language sql stable security definer set search_path = '' as $$
|
||||
select coalesce(jsonb_agg(x order by created_at desc), '[]'::jsonb)
|
||||
from (
|
||||
select n.id, n.kind, n.created_at, n.read_at, n.emoji, n.item_id, n.episode, n.ep_count,
|
||||
case when p.id is null then null else
|
||||
jsonb_build_object('username', p.username, 'display_name', p.display_name, 'avatar_url', p.avatar_url) end as actor,
|
||||
case
|
||||
when n.kind in ('reaction', 'review_comment', 'new_episode', 'new_season')
|
||||
then (select it.data->>'title' from public.items it where it.user_id = n.user_id and it.id = n.item_id)
|
||||
when n.kind = 'shared_list_invite'
|
||||
then (select sl.name from public.shared_lists sl where sl.id::text = n.item_id)
|
||||
end as title,
|
||||
case when n.kind = 'shared_list_invite'
|
||||
then (select m.status from public.shared_list_members m where m.list_id::text = n.item_id and m.user_id = n.user_id)
|
||||
end as invite_status
|
||||
from public.notifications n
|
||||
left join public.profiles p on p.id = n.actor_id
|
||||
where n.user_id = auth.uid() and public.azuu_wants(n.user_id, n.kind)
|
||||
order by n.created_at desc
|
||||
offset greatest(p_offset, 0) limit 30
|
||||
) x
|
||||
$$;
|
||||
|
||||
-- ── Droits ──
|
||||
revoke all on function public.azuu_sl_member(uuid), public.azuu_sl_owner(uuid), public.azuu_sl_name(text),
|
||||
public.azuu_mini_card(public.profiles), public.azuu_me_active()
|
||||
from public, anon, authenticated;
|
||||
revoke all on function public.get_shared_lists(text), public.get_shared_list(uuid), public.shared_list_candidates(uuid, text),
|
||||
public.create_shared_list(text), public.rename_shared_list(uuid, text), public.delete_shared_list(uuid),
|
||||
public.invite_to_shared_list(uuid, uuid), public.respond_shared_list_invite(uuid, boolean), public.leave_shared_list(uuid),
|
||||
public.remove_shared_list_member(uuid, uuid), public.add_shared_list_item(uuid, jsonb), public.remove_shared_list_item(uuid, text),
|
||||
public.get_notifications(integer)
|
||||
from public, anon;
|
||||
grant execute on function public.get_shared_lists(text), public.get_shared_list(uuid), public.shared_list_candidates(uuid, text),
|
||||
public.create_shared_list(text), public.rename_shared_list(uuid, text), public.delete_shared_list(uuid),
|
||||
public.invite_to_shared_list(uuid, uuid), public.respond_shared_list_invite(uuid, boolean), public.leave_shared_list(uuid),
|
||||
public.remove_shared_list_member(uuid, uuid), public.add_shared_list_item(uuid, jsonb), public.remove_shared_list_item(uuid, text),
|
||||
public.get_notifications(integer)
|
||||
to authenticated;
|
||||
Reference in new issue
Block a user