Profil : Top 1, onglet Top 5, 5 derniers vus, plus de stats ni d'« À voir »
deploy / deploy (push) Successful in 40s
deploy / deploy (push) Successful in 40s
- Onglet Profil : une ligne « Top 1 » (le n°1 de chaque Top 5), « En cours », et les 5 derniers vus - Nouvel onglet « Top 5 » entre Profil et Bibliothèque, avec les classements complets - Stats détaillées et « À voir » retirés du profil (déjà dans Stats et Bibliothèque) - Bouton « Modifier le profil » (et S'abonner) sous la bannière au lieu de mordre dessus - Serveur (migration 20261128140000, appliquée) : get_profile n'envoie plus que le nombre de titres vus, les 5 derniers vus et plus la liste « À voir » - 4 textes devenus inutiles retirés (18 langues) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
22 files changed
+139
-150
No files matched your search
@@ -61,7 +61,7 @@ npm run build # build de prod
|
||||
- RTL géré (arabe) : préférer les classes logiques (`ps-`/`pe-`, `ms-`/`me-`, `start-`/`end-`, `border-e`).
|
||||
|
||||
## État (au 28 nov. 2026)
|
||||
- **Toutes les migrations de `supabase/migrations/` sont appliquées en ligne**, jusqu'à `20261128130000_notifications_actor_index.sql` incluse.
|
||||
- **Toutes les migrations de `supabase/migrations/` sont appliquées en ligne**, jusqu'à `20261128140000_profile_slim.sql` incluse.
|
||||
- **Notifications : abonnements uniquement** (27 nov. 2026) — cloche sur l'accueil, dans l'app, pas de push. Types : `new_follower`, `follow_request`, `unfollow`, `follow_accepted` (trigger `follows_notify`, RPC `get_notifications` / `unread_notifications` / `mark_notifications_read`). Les anciennes notifications (push, commentaires, épisodes, invitations) et `azuu_notify` ont été supprimées. La fonction Edge `send-push` répond 410 : à supprimer depuis le tableau de bord Supabase.
|
||||
- **Retirés (27-28 nov. 2026)** : défis, couleur d'accent au choix, apparences Nuit/Étoilé, notation sur 10 (les notes restent stockées sur 10 en interne, affichées sur 5 étoiles).
|
||||
- **Chargement** : les écrans rares (stats, réglages, admin, roulette, calendrier, écrans sociaux…) sont chargés à la demande puis préchargés au repos (`App.tsx` → `loaders`, `SocialProvider.tsx` → `socialLoaders`).
|
||||
|
||||
@@ -55,7 +55,7 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
||||
const { settings } = useMedia()
|
||||
const [profile, setProfile] = useState<Profile | null>()
|
||||
const [error, setError] = useState<string>()
|
||||
const [tab, setTab] = useState<'profile' | 'library'>('profile')
|
||||
const [tab, setTab] = useState<'profile' | 'top' | 'library'>('profile')
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [confirmUnfollow, setConfirmUnfollow] = useState(false)
|
||||
const [toast, setToast] = useState<string>()
|
||||
@@ -174,12 +174,12 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
||||
}
|
||||
|
||||
const topByCategory = useMemo(() => {
|
||||
const out: { label: string; items: MediaItem[] }[] = []
|
||||
const out: { label: string; single: string; items: MediaItem[] }[] = []
|
||||
// Mon profil : mes réglages locaux font foi tout de suite (même avant la synchro)
|
||||
const shown = profile?.isMe ? TOP_CATEGORIES.filter((c) => settings.topCategories.includes(c.value)) : TOP_CATEGORIES
|
||||
for (const c of shown) {
|
||||
const list = (profile?.top ?? []).filter((i) => i.top?.category === c.value).sort((a, b) => a.top!.rank - b.top!.rank)
|
||||
if (list.length) out.push({ label: c.plural, items: list })
|
||||
if (list.length) out.push({ label: c.plural, single: c.label, items: list })
|
||||
}
|
||||
return out
|
||||
}, [profile, settings.topCategories])
|
||||
@@ -213,14 +213,15 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
||||
{profile.bannerUrl && <img src={profile.bannerUrl} alt="" className="size-full object-cover" />}
|
||||
</div>
|
||||
<div className="px-4 lg:px-10">
|
||||
<div className="relative -mt-11 flex items-end justify-between gap-3 lg:-mt-14">
|
||||
{/* La photo chevauche la bannière ; les boutons restent en dessous (pt = partie de la photo posée sur la bannière + marge) */}
|
||||
<div className="relative -mt-11 flex items-start justify-between gap-3 lg:-mt-14">
|
||||
<Avatar url={profile.avatarUrl} name={profile.displayName} size={88} className="border-4 border-bg" />
|
||||
{profile.isMe ? (
|
||||
<button onClick={social.openEdit} className="btn btn-ghost mb-1 px-4 py-2 text-sm">
|
||||
<button onClick={social.openEdit} className="btn btn-ghost mt-[3.5rem] px-4 py-2 text-sm lg:mt-[4.25rem]">
|
||||
{t('social.editProfile')}
|
||||
</button>
|
||||
) : (
|
||||
<div className="mb-1 flex items-center gap-1">
|
||||
<div className="mt-[3.5rem] flex items-center gap-1 lg:mt-[4.25rem]">
|
||||
{blocked ? (
|
||||
<button onClick={doUnblock} disabled={busy} className="btn btn-ghost px-4 py-2 text-sm">
|
||||
{busy ? <Loader2 size={15} className="animate-spin" /> : <UserCheck size={15} />}
|
||||
@@ -279,7 +280,7 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
||||
)}
|
||||
|
||||
<div className="mt-5 flex divide-x divide-line rounded-2xl border border-line py-3 lg:max-w-2xl">
|
||||
<Stat value={profile.visible ? (profile.stats?.finished ?? 0) : undefined} label={t('social.seen')} />
|
||||
<Stat value={profile.visible ? (profile.seen ?? 0) : undefined} label={t('social.seen')} />
|
||||
<Stat value={profile.followers} label={t('social.followers', { count: profile.followers })} onClick={profile.visible ? () => social.openFollowList(profile, 'followers') : undefined} />
|
||||
<Stat value={profile.following} label={t('social.followingCount', { count: profile.following })} onClick={profile.visible ? () => social.openFollowList(profile, 'following') : undefined} />
|
||||
</div>
|
||||
@@ -299,19 +300,21 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="mt-6 grid grid-cols-2 gap-1 rounded-md border border-line p-1 lg:max-w-md">
|
||||
{(['profile', 'library'] as const).map((v) => (
|
||||
<div className={cx('mt-6 grid gap-1 rounded-md border border-line p-1 lg:max-w-md', topByCategory.length ? 'grid-cols-3' : 'grid-cols-2')}>
|
||||
{(topByCategory.length ? (['profile', 'top', 'library'] as const) : (['profile', 'library'] as const)).map((v) => (
|
||||
<button
|
||||
key={v}
|
||||
onClick={() => setTab(v)}
|
||||
className={cx('rounded-md py-2 text-sm font-medium transition-colors', tab === v ? 'bg-ink text-bg' : 'text-ink-3')}
|
||||
>
|
||||
{v === 'profile' ? t('social.tabProfile') : t('social.tabLibrary')}
|
||||
{v === 'profile' ? t('social.tabProfile') : v === 'top' ? t('social.top5') : t('social.tabLibrary')}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{tab === 'profile' ? (
|
||||
<ProfileTab profile={profile} topByCategory={topByCategory} onOpen={openItem} />
|
||||
) : tab === 'top' && topByCategory.length ? (
|
||||
<TopTab topByCategory={topByCategory} onOpen={openItem} />
|
||||
) : (
|
||||
<LibraryTab profile={profile} onOpen={openItem} />
|
||||
)}
|
||||
@@ -346,25 +349,24 @@ export default function ProfileView({ username, onClose }: { username: string; o
|
||||
)
|
||||
}
|
||||
|
||||
function ProfileTab({ profile, topByCategory, onOpen }: { profile: Profile; topByCategory: { label: string; items: MediaItem[] }[]; onOpen: (i: MediaItem) => void }) {
|
||||
const s = profile.stats
|
||||
type TopGroup = { label: string; single: string; items: MediaItem[] }
|
||||
|
||||
/** Onglet Profil : le n°1 de chaque Top 5, ce que je regarde, mes 5 derniers vus. */
|
||||
function ProfileTab({ profile, topByCategory, onOpen }: { profile: Profile; topByCategory: TopGroup[]; onOpen: (i: MediaItem) => void }) {
|
||||
const firsts = topByCategory.flatMap((c) => (c.items[0]?.top?.rank === 1 ? [{ item: c.items[0], category: c.single }] : []))
|
||||
const recent = profile.recent.slice(0, 5)
|
||||
return (
|
||||
<>
|
||||
{topByCategory.map((c) => (
|
||||
<section key={c.label}>
|
||||
<SectionTitle>
|
||||
{t('social.top5')} · {c.label}
|
||||
</SectionTitle>
|
||||
{firsts.length > 0 && (
|
||||
<>
|
||||
<SectionTitle>{t('social.top1')}</SectionTitle>
|
||||
<div className="grid grid-cols-5 gap-2 lg:grid-cols-8 lg:gap-3 xl:grid-cols-10">
|
||||
{c.items.map((item) => (
|
||||
<div key={item.id} className="relative">
|
||||
<PosterTile item={item} onOpen={() => onOpen(item)} />
|
||||
<span className="absolute start-1 top-1 grid size-5 place-items-center rounded-full bg-bg/85 text-[10px] font-bold">{item.top!.rank}</span>
|
||||
</div>
|
||||
{firsts.map(({ item, category }) => (
|
||||
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} caption={category} />
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
|
||||
{profile.watching.length > 0 && (
|
||||
<>
|
||||
@@ -378,45 +380,36 @@ function ProfileTab({ profile, topByCategory, onOpen }: { profile: Profile; topB
|
||||
)}
|
||||
|
||||
<SectionTitle>{t('social.recent')}</SectionTitle>
|
||||
{profile.recent.length ? (
|
||||
<div className="grid grid-cols-4 gap-2.5 sm:grid-cols-5 lg:grid-cols-8 lg:gap-3 xl:grid-cols-10">
|
||||
{profile.recent.map((item) => (
|
||||
{recent.length ? (
|
||||
<div className="grid grid-cols-5 gap-2 lg:grid-cols-8 lg:gap-3 xl:grid-cols-10">
|
||||
{recent.map((item) => (
|
||||
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} />
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-sm text-ink-3">{t('social.noRecent')}</p>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
{profile.watchlist.length > 0 && (
|
||||
<>
|
||||
<SectionTitle>{t('social.watchlist')}</SectionTitle>
|
||||
<div className="grid grid-cols-4 gap-2.5 sm:grid-cols-5 lg:grid-cols-8 lg:gap-3 xl:grid-cols-10">
|
||||
{profile.watchlist.map((item) => (
|
||||
<PosterTile key={item.id} item={item} onOpen={() => onOpen(item)} />
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{s && (
|
||||
<>
|
||||
<SectionTitle>{t('nav.stats')}</SectionTitle>
|
||||
<div className="grid grid-cols-2 gap-3 lg:grid-cols-4">
|
||||
{[
|
||||
[s.finishedYear, t('social.statYear')],
|
||||
[s.films, t('social.statFilms')],
|
||||
[s.series, t('social.statSeries')],
|
||||
[s.episodes, t('home.episodesSeen')],
|
||||
].map(([v, label]) => (
|
||||
<div key={label as string} className="card p-4">
|
||||
<div className="eyebrow">{label}</div>
|
||||
<div className="mt-2 text-2xl font-bold tabular-nums leading-none">{fmtNumber(v as number)}</div>
|
||||
/** Onglet Top 5 : les classements complets, catégorie par catégorie. */
|
||||
function TopTab({ topByCategory, onOpen }: { topByCategory: TopGroup[]; onOpen: (i: MediaItem) => void }) {
|
||||
return (
|
||||
<>
|
||||
{topByCategory.map((c) => (
|
||||
<section key={c.label}>
|
||||
<SectionTitle>{c.label}</SectionTitle>
|
||||
<div className="grid grid-cols-5 gap-2 lg:grid-cols-8 lg:gap-3 xl:grid-cols-10">
|
||||
{c.items.map((item) => (
|
||||
<div key={item.id} className="relative">
|
||||
<PosterTile item={item} onOpen={() => onOpen(item)} />
|
||||
<span className="absolute start-1 top-1 grid size-5 place-items-center rounded-full bg-bg/85 text-[10px] font-bold">{item.top!.rank}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</section>
|
||||
))}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -754,12 +754,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'هذا الحساب خاص: ستحتاج إلى إرسال طلب جديد لرؤية ملفه الشخصي مجددًا.',
|
||||
'social.cancelRequest': 'إلغاء الطلب',
|
||||
'social.unfollow': 'إلغاء المتابعة',
|
||||
'social.top1': 'الأول',
|
||||
'social.top5': 'أفضل 5',
|
||||
'social.recent': 'شوهدت مؤخرًا',
|
||||
'social.noRecent': 'لم يكتمل شيء بعد.',
|
||||
'social.statYear': 'شوهدت هذا العام',
|
||||
'social.statFilms': 'أفلام شوهدت',
|
||||
'social.statSeries': 'مسلسلات وأنمي شوهدت',
|
||||
'social.emptyLibrary': 'لا عناوين هنا.',
|
||||
'social.loadMore': 'عرض المزيد',
|
||||
'social.changeBanner': 'تغيير الغلاف',
|
||||
@@ -822,7 +820,6 @@ const dict: Translations = {
|
||||
'welcome.go': 'هيا بنا',
|
||||
'welcome.later': 'لاحقًا',
|
||||
'social.watching': 'قيد المشاهدة',
|
||||
'social.watchlist': 'يرغب في مشاهدتها',
|
||||
'search.animeOnly': 'بدون مفتاح TMDB، يمكن العثور على الأنمي فقط.',
|
||||
'form.startShort': 'بدأ في',
|
||||
'form.endShort': 'انتهى في',
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'Dieses Konto ist privat: Du musst erneut anfragen, um das Profil wieder zu sehen.',
|
||||
'social.cancelRequest': 'Anfrage zurückziehen',
|
||||
'social.unfollow': 'Nicht mehr folgen',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Zuletzt gesehen',
|
||||
'social.noRecent': 'Noch nichts abgeschlossen.',
|
||||
'social.statYear': 'Dieses Jahr gesehen',
|
||||
'social.statFilms': 'Filme gesehen',
|
||||
'social.statSeries': 'Serien & Animes gesehen',
|
||||
'social.emptyLibrary': 'Hier gibt’s keine Titel.',
|
||||
'social.loadMore': 'Mehr anzeigen',
|
||||
'social.changeBanner': 'Banner ändern',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': "Los geht's",
|
||||
'welcome.later': "Später",
|
||||
'social.watching': "Schaut gerade",
|
||||
'social.watchlist': "Möchte sehen",
|
||||
'search.animeOnly': "Ohne TMDB-Schlüssel werden nur Animes gefunden.",
|
||||
'form.startShort': "Begonnen",
|
||||
'form.endShort': "Beendet",
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'This account is private: you’ll have to send a new request to see their profile again.',
|
||||
'social.cancelRequest': 'Cancel request',
|
||||
'social.unfollow': 'Unfollow',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Recently watched',
|
||||
'social.noRecent': 'Nothing finished yet.',
|
||||
'social.statYear': 'Watched this year',
|
||||
'social.statFilms': 'Movies watched',
|
||||
'social.statSeries': 'Series & anime watched',
|
||||
'social.emptyLibrary': 'No titles here.',
|
||||
'social.loadMore': 'Show more',
|
||||
'social.changeBanner': 'Change banner',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': "Let's go",
|
||||
'welcome.later': "Later",
|
||||
'social.watching': "Watching",
|
||||
'social.watchlist': "Wants to watch",
|
||||
'search.animeOnly': "Without a TMDB key, only anime can be found.",
|
||||
'form.startShort': "Started",
|
||||
'form.endShort': "Finished",
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'Esta cuenta es privada: tendrás que volver a enviar una solicitud para ver su perfil.',
|
||||
'social.cancelRequest': 'Cancelar solicitud',
|
||||
'social.unfollow': 'Dejar de seguir',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Vistos recientemente',
|
||||
'social.noRecent': 'Nada terminado por ahora.',
|
||||
'social.statYear': 'Vistos este año',
|
||||
'social.statFilms': 'Películas vistas',
|
||||
'social.statSeries': 'Series y animes vistos',
|
||||
'social.emptyLibrary': 'No hay ningún título aquí.',
|
||||
'social.loadMore': 'Ver más',
|
||||
'social.changeBanner': 'Cambiar el banner',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': "Vamos",
|
||||
'welcome.later': "Más tarde",
|
||||
'social.watching': "Viendo",
|
||||
'social.watchlist': "Quiere ver",
|
||||
'search.animeOnly': "Sin clave de TMDB solo se encuentran animes.",
|
||||
'form.startShort': "Empezado",
|
||||
'form.endShort': "Terminado",
|
||||
|
||||
@@ -660,12 +660,10 @@ const dict = {
|
||||
'social.unfollowPrivate': 'Ce compte est privé : il faudra refaire une demande pour revoir son profil.',
|
||||
'social.cancelRequest': 'Annuler la demande',
|
||||
'social.unfollow': 'Se désabonner',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Vus récemment',
|
||||
'social.noRecent': 'Rien de terminé pour l\'instant.',
|
||||
'social.statYear': 'Vus cette année',
|
||||
'social.statFilms': 'Films vus',
|
||||
'social.statSeries': 'Séries & animes vus',
|
||||
'social.emptyLibrary': 'Aucun titre ici.',
|
||||
'social.loadMore': 'Voir plus',
|
||||
'social.changeBanner': 'Changer la bannière',
|
||||
@@ -725,7 +723,6 @@ const dict = {
|
||||
'welcome.go': "C'est parti",
|
||||
'welcome.later': "Plus tard",
|
||||
'social.watching': "En cours",
|
||||
'social.watchlist': "Envie de voir",
|
||||
'search.animeOnly': "Sans clé TMDB, seuls les animes sont trouvés.",
|
||||
'form.startShort': "Commencé le",
|
||||
'form.endShort': "Fini le",
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'यह अकाउंट प्राइवेट है: उनकी प्रोफ़ाइल फिर से देखने के लिए आपको नई रिक्वेस्ट भेजनी होगी।',
|
||||
'social.cancelRequest': 'रिक्वेस्ट रद्द करें',
|
||||
'social.unfollow': 'अनफ़ॉलो करें',
|
||||
'social.top1': 'टॉप 1',
|
||||
'social.top5': 'टॉप 5',
|
||||
'social.recent': 'हाल ही में देखे',
|
||||
'social.noRecent': 'अभी तक कुछ पूरा नहीं किया।',
|
||||
'social.statYear': 'इस साल देखे',
|
||||
'social.statFilms': 'देखी गई फ़िल्में',
|
||||
'social.statSeries': 'देखी गई सीरीज़ और एनिमे',
|
||||
'social.emptyLibrary': 'यहाँ कोई टाइटल नहीं।',
|
||||
'social.loadMore': 'और दिखाएँ',
|
||||
'social.changeBanner': 'बैनर बदलें',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': 'चलिए शुरू करें',
|
||||
'welcome.later': 'बाद में',
|
||||
'social.watching': 'देख रहे हैं',
|
||||
'social.watchlist': 'देखना चाहते हैं',
|
||||
'search.animeOnly': 'TMDB की के बिना सिर्फ़ एनिमे खोजे जा सकते हैं।',
|
||||
'form.startShort': 'शुरू किया',
|
||||
'form.endShort': 'पूरा किया',
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'Akun ini privat: kamu harus mengirim permintaan lagi untuk melihat profilnya.',
|
||||
'social.cancelRequest': 'Batalkan permintaan',
|
||||
'social.unfollow': 'Berhenti mengikuti',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Baru ditonton',
|
||||
'social.noRecent': 'Belum ada yang selesai.',
|
||||
'social.statYear': 'Ditonton tahun ini',
|
||||
'social.statFilms': 'Film ditonton',
|
||||
'social.statSeries': 'Serial & anime ditonton',
|
||||
'social.emptyLibrary': 'Tidak ada judul di sini.',
|
||||
'social.loadMore': 'Lihat lebih banyak',
|
||||
'social.changeBanner': 'Ganti banner',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': 'Ayo mulai',
|
||||
'welcome.later': 'Nanti saja',
|
||||
'social.watching': 'Sedang ditonton',
|
||||
'social.watchlist': 'Mau ditonton',
|
||||
'search.animeOnly': 'Tanpa kunci TMDB, hanya anime yang bisa ditemukan.',
|
||||
'form.startShort': 'Mulai',
|
||||
'form.endShort': 'Selesai',
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'Questo account è privato: dovrai inviare una nuova richiesta per rivedere il suo profilo.',
|
||||
'social.cancelRequest': 'Annulla la richiesta',
|
||||
'social.unfollow': 'Smetti di seguire',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Visti di recente',
|
||||
'social.noRecent': 'Ancora niente di finito.',
|
||||
'social.statYear': 'Visti quest’anno',
|
||||
'social.statFilms': 'Film visti',
|
||||
'social.statSeries': 'Serie e anime visti',
|
||||
'social.emptyLibrary': 'Nessun titolo qui.',
|
||||
'social.loadMore': 'Mostra altro',
|
||||
'social.changeBanner': 'Cambia il banner',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': "Iniziamo",
|
||||
'welcome.later': "Più tardi",
|
||||
'social.watching': "In corso",
|
||||
'social.watchlist': "Vuole vedere",
|
||||
'search.animeOnly': "Senza chiave TMDB si trovano solo gli anime.",
|
||||
'form.startShort': "Iniziato",
|
||||
'form.endShort': "Finito",
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'このアカウントは非公開です。再びプロフィールを見るには、もう一度リクエストが必要です。',
|
||||
'social.cancelRequest': 'リクエストを取り消す',
|
||||
'social.unfollow': 'フォロー解除',
|
||||
'social.top1': 'トップ1',
|
||||
'social.top5': 'トップ5',
|
||||
'social.recent': '最近見た作品',
|
||||
'social.noRecent': 'まだ見終わった作品はありません。',
|
||||
'social.statYear': '今年見た作品',
|
||||
'social.statFilms': '見た映画',
|
||||
'social.statSeries': '見たドラマ・アニメ',
|
||||
'social.emptyLibrary': 'ここには作品がありません。',
|
||||
'social.loadMore': 'もっと見る',
|
||||
'social.changeBanner': 'バナーを変更',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': "はじめる",
|
||||
'welcome.later': "あとで",
|
||||
'social.watching': "視聴中",
|
||||
'social.watchlist': "見たい",
|
||||
'search.animeOnly': "TMDB キーがない場合はアニメのみ検索できます。",
|
||||
'form.startShort': "開始日",
|
||||
'form.endShort': "完了日",
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': '비공개 계정이라 프로필을 다시 보려면 팔로우 요청을 다시 보내야 해요.',
|
||||
'social.cancelRequest': '요청 취소',
|
||||
'social.unfollow': '언팔로우',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': '최근 본 작품',
|
||||
'social.noRecent': '아직 다 본 작품이 없어요.',
|
||||
'social.statYear': '올해 본 작품',
|
||||
'social.statFilms': '본 영화',
|
||||
'social.statSeries': '본 시리즈 & 애니',
|
||||
'social.emptyLibrary': '여기엔 작품이 없어요.',
|
||||
'social.loadMore': '더 보기',
|
||||
'social.changeBanner': '배너 변경',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': "시작하기",
|
||||
'welcome.later': "나중에",
|
||||
'social.watching': "보는 중",
|
||||
'social.watchlist': "보고 싶어요",
|
||||
'search.animeOnly': "TMDB 키가 없으면 애니만 찾을 수 있어요.",
|
||||
'form.startShort': "시작일",
|
||||
'form.endShort': "완료일",
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'Dit account is privé: je moet opnieuw een verzoek sturen om het profiel weer te zien.',
|
||||
'social.cancelRequest': 'Verzoek annuleren',
|
||||
'social.unfollow': 'Ontvolgen',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Onlangs gezien',
|
||||
'social.noRecent': 'Nog niets uitgekeken.',
|
||||
'social.statYear': 'Gezien dit jaar',
|
||||
'social.statFilms': 'Films gezien',
|
||||
'social.statSeries': 'Series & anime gezien',
|
||||
'social.emptyLibrary': 'Geen titels hier.',
|
||||
'social.loadMore': 'Meer tonen',
|
||||
'social.changeBanner': 'Banner wijzigen',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': "Aan de slag",
|
||||
'welcome.later': "Later",
|
||||
'social.watching': "Bezig",
|
||||
'social.watchlist': "Wil ik zien",
|
||||
'search.animeOnly': "Zonder TMDB-sleutel worden alleen anime gevonden.",
|
||||
'form.startShort': "Begonnen op",
|
||||
'form.endShort': "Uitgekeken op",
|
||||
|
||||
@@ -722,12 +722,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'To konto jest prywatne: aby znów zobaczyć profil, trzeba będzie wysłać nową prośbę.',
|
||||
'social.cancelRequest': 'Anuluj prośbę',
|
||||
'social.unfollow': 'Przestań obserwować',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Ostatnio obejrzane',
|
||||
'social.noRecent': 'Na razie nic nie zostało ukończone.',
|
||||
'social.statYear': 'Obejrzane w tym roku',
|
||||
'social.statFilms': 'Obejrzane filmy',
|
||||
'social.statSeries': 'Obejrzane seriale i anime',
|
||||
'social.emptyLibrary': 'Brak tytułów.',
|
||||
'social.loadMore': 'Pokaż więcej',
|
||||
'social.changeBanner': 'Zmień baner',
|
||||
@@ -789,7 +787,6 @@ const dict: Translations = {
|
||||
'welcome.go': 'Zaczynamy',
|
||||
'welcome.later': 'Później',
|
||||
'social.watching': 'W trakcie',
|
||||
'social.watchlist': 'Chce obejrzeć',
|
||||
'search.animeOnly': 'Bez klucza TMDB można znaleźć tylko anime.',
|
||||
'form.startShort': 'Rozpoczęto',
|
||||
'form.endShort': 'Ukończono',
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'Esta conta é privada: você vai precisar solicitar de novo para ver o perfil.',
|
||||
'social.cancelRequest': 'Cancelar solicitação',
|
||||
'social.unfollow': 'Deixar de seguir',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Vistos recentemente',
|
||||
'social.noRecent': 'Nada concluído por enquanto.',
|
||||
'social.statYear': 'Vistos este ano',
|
||||
'social.statFilms': 'Filmes vistos',
|
||||
'social.statSeries': 'Séries e animes vistos',
|
||||
'social.emptyLibrary': 'Nenhum título aqui.',
|
||||
'social.loadMore': 'Ver mais',
|
||||
'social.changeBanner': 'Trocar o banner',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': "Vamos lá",
|
||||
'welcome.later': "Depois",
|
||||
'social.watching': "Assistindo",
|
||||
'social.watchlist': "Quer assistir",
|
||||
'search.animeOnly': "Sem chave do TMDB, só animes são encontrados.",
|
||||
'form.startShort': "Começou",
|
||||
'form.endShort': "Terminou",
|
||||
|
||||
@@ -722,12 +722,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'Это закрытый аккаунт: чтобы снова увидеть профиль, придётся отправить новый запрос.',
|
||||
'social.cancelRequest': 'Отменить запрос',
|
||||
'social.unfollow': 'Отписаться',
|
||||
'social.top1': 'Топ 1',
|
||||
'social.top5': 'Топ 5',
|
||||
'social.recent': 'Недавно просмотренные',
|
||||
'social.noRecent': 'Пока ничего не досмотрено.',
|
||||
'social.statYear': 'Просмотрено в этом году',
|
||||
'social.statFilms': 'Просмотрено фильмов',
|
||||
'social.statSeries': 'Просмотрено сериалов и аниме',
|
||||
'social.emptyLibrary': 'Здесь нет тайтлов.',
|
||||
'social.loadMore': 'Показать ещё',
|
||||
'social.changeBanner': 'Сменить баннер',
|
||||
@@ -789,7 +787,6 @@ const dict: Translations = {
|
||||
'welcome.go': 'Поехали',
|
||||
'welcome.later': 'Позже',
|
||||
'social.watching': 'Смотрит',
|
||||
'social.watchlist': 'Хочет посмотреть',
|
||||
'search.animeOnly': 'Без ключа TMDB можно найти только аниме.',
|
||||
'form.startShort': 'Начато',
|
||||
'form.endShort': 'Закончено',
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'บัญชีนี้เป็นบัญชีส่วนตัว คุณจะต้องส่งคำขอใหม่เพื่อดูโปรไฟล์อีกครั้ง',
|
||||
'social.cancelRequest': 'ยกเลิกคำขอ',
|
||||
'social.unfollow': 'เลิกติดตาม',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'ดูล่าสุด',
|
||||
'social.noRecent': 'ยังไม่มีเรื่องที่ดูจบ',
|
||||
'social.statYear': 'ดูในปีนี้',
|
||||
'social.statFilms': 'ภาพยนตร์ที่ดูแล้ว',
|
||||
'social.statSeries': 'ซีรีส์และอนิเมะที่ดูแล้ว',
|
||||
'social.emptyLibrary': 'ไม่มีเรื่องที่นี่',
|
||||
'social.loadMore': 'ดูเพิ่มเติม',
|
||||
'social.changeBanner': 'เปลี่ยนแบนเนอร์',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': 'ไปกันเลย',
|
||||
'welcome.later': 'ไว้ทีหลัง',
|
||||
'social.watching': 'กำลังดู',
|
||||
'social.watchlist': 'อยากดู',
|
||||
'search.animeOnly': 'หากไม่มีคีย์ TMDB จะค้นหาได้เฉพาะอนิเมะ',
|
||||
'form.startShort': 'เริ่มดูเมื่อ',
|
||||
'form.endShort': 'ดูจบเมื่อ',
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'Bu hesap gizli: profilini tekrar görmek için yeni bir istek göndermen gerekecek.',
|
||||
'social.cancelRequest': 'İsteği iptal et',
|
||||
'social.unfollow': 'Takibi bırak',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Son izlenenler',
|
||||
'social.noRecent': 'Henüz biten bir şey yok.',
|
||||
'social.statYear': 'Bu yıl izlenen',
|
||||
'social.statFilms': 'İzlenen filmler',
|
||||
'social.statSeries': 'İzlenen dizi ve animeler',
|
||||
'social.emptyLibrary': 'Burada yapım yok.',
|
||||
'social.loadMore': 'Daha fazla göster',
|
||||
'social.changeBanner': 'Kapağı değiştir',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': "Hadi başlayalım",
|
||||
'welcome.later': "Sonra",
|
||||
'social.watching': "İzliyor",
|
||||
'social.watchlist': "İzlemek istiyor",
|
||||
'search.animeOnly': "TMDB anahtarı olmadan yalnızca anime bulunabilir.",
|
||||
'form.startShort': "Başlangıç",
|
||||
'form.endShort': "Bitiş",
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': 'Tài khoản này ở chế độ riêng tư: bạn sẽ phải gửi lại yêu cầu để xem hồ sơ của họ.',
|
||||
'social.cancelRequest': 'Hủy yêu cầu',
|
||||
'social.unfollow': 'Bỏ theo dõi',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': 'Xem gần đây',
|
||||
'social.noRecent': 'Chưa xem xong phim nào.',
|
||||
'social.statYear': 'Đã xem năm nay',
|
||||
'social.statFilms': 'Phim lẻ đã xem',
|
||||
'social.statSeries': 'Phim bộ & anime đã xem',
|
||||
'social.emptyLibrary': 'Không có phim nào ở đây.',
|
||||
'social.loadMore': 'Xem thêm',
|
||||
'social.changeBanner': 'Đổi ảnh bìa',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': 'Bắt đầu thôi',
|
||||
'welcome.later': 'Để sau',
|
||||
'social.watching': 'Đang xem',
|
||||
'social.watchlist': 'Muốn xem',
|
||||
'search.animeOnly': 'Không có khóa TMDB thì chỉ tìm được anime.',
|
||||
'form.startShort': 'Bắt đầu',
|
||||
'form.endShort': 'Xem xong',
|
||||
|
||||
@@ -658,12 +658,10 @@ const dict: Translations = {
|
||||
'social.unfollowPrivate': '这是私密账号:之后想再看 Ta 的主页需要重新申请。',
|
||||
'social.cancelRequest': '取消申请',
|
||||
'social.unfollow': '取消关注',
|
||||
'social.top1': 'Top 1',
|
||||
'social.top5': 'Top 5',
|
||||
'social.recent': '最近看过',
|
||||
'social.noRecent': '暂时还没有看完的作品。',
|
||||
'social.statYear': '今年看过',
|
||||
'social.statFilms': '看过的电影',
|
||||
'social.statSeries': '看过的剧集和动画',
|
||||
'social.emptyLibrary': '这里还没有作品。',
|
||||
'social.loadMore': '查看更多',
|
||||
'social.changeBanner': '更换横幅',
|
||||
@@ -723,7 +721,6 @@ const dict: Translations = {
|
||||
'welcome.go': "开始吧",
|
||||
'welcome.later': "稍后",
|
||||
'social.watching': "正在看",
|
||||
'social.watchlist': "想看",
|
||||
'search.animeOnly': "没有 TMDB 密钥时只能找到动画。",
|
||||
'form.startShort': "开始于",
|
||||
'form.endShort': "看完于",
|
||||
|
||||
+3
-24
@@ -23,16 +23,6 @@ export interface ProfileCard {
|
||||
relation: Relation
|
||||
}
|
||||
|
||||
export interface ProfileStats {
|
||||
total: number
|
||||
finished: number
|
||||
finishedYear: number
|
||||
films: number
|
||||
series: number
|
||||
episodes: number
|
||||
rated: number
|
||||
}
|
||||
|
||||
export interface Profile extends ProfileCard {
|
||||
bio: string
|
||||
bannerUrl?: string
|
||||
@@ -41,11 +31,11 @@ export interface Profile extends ProfileCard {
|
||||
followers: number
|
||||
following: number
|
||||
visible: boolean
|
||||
stats?: ProfileStats
|
||||
/** Titres vus (absent si le profil n'est pas visible) */
|
||||
seen?: number
|
||||
top: MediaItem[]
|
||||
recent: MediaItem[]
|
||||
watching: MediaItem[]
|
||||
watchlist: MediaItem[]
|
||||
}
|
||||
|
||||
export interface FeedEntry {
|
||||
@@ -112,21 +102,10 @@ function toProfile(raw: unknown): Profile | null {
|
||||
followers: count(raw.followers),
|
||||
following: count(raw.following),
|
||||
visible: raw.visible === true,
|
||||
stats: s
|
||||
? {
|
||||
total: count(s.total),
|
||||
finished: count(s.finished),
|
||||
finishedYear: count(s.finished_year),
|
||||
films: count(s.films),
|
||||
series: count(s.series),
|
||||
episodes: count(s.episodes),
|
||||
rated: count(s.rated),
|
||||
}
|
||||
: undefined,
|
||||
seen: s ? count(s.finished) : undefined,
|
||||
top: toItems(raw.top),
|
||||
recent: toItems(raw.recent),
|
||||
watching: toItems(raw.watching),
|
||||
watchlist: toItems(raw.watchlist),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
-- Bobinoo — profil allégé (28 nov. 2026). Idempotent.
|
||||
-- Le profil n'affiche plus les stats détaillées ni « À voir » (ils sont dans Stats et Bibliothèque),
|
||||
-- et « Vus récemment » montre les 5 derniers : on n'envoie plus que ça.
|
||||
create or replace function public.get_profile(p_username text)
|
||||
returns jsonb language plpgsql stable security definer set search_path = '' as $$
|
||||
declare
|
||||
p public.profiles;
|
||||
me uuid := auth.uid();
|
||||
res jsonb;
|
||||
begin
|
||||
if me is null then
|
||||
return null;
|
||||
end if;
|
||||
select * into p from public.profiles where username = lower(trim(p_username));
|
||||
if not found then
|
||||
return null;
|
||||
end if;
|
||||
if p.suspended and p.id <> me and not public.is_admin() then
|
||||
return null;
|
||||
end if;
|
||||
if p.id <> me and exists (select 1 from public.blocks b where b.blocker_id = p.id and b.blocked_id = me) then
|
||||
return null;
|
||||
end if;
|
||||
res := public.profile_card(p) || jsonb_build_object(
|
||||
'bio', p.bio,
|
||||
'banner_url', p.banner_url,
|
||||
'is_me', p.id = me,
|
||||
'follows_me', exists (select 1 from public.follows where follower_id = p.id and following_id = me and status = 'accepted'),
|
||||
'followers', (select count(*) from public.follows where following_id = p.id and status = 'accepted'),
|
||||
'following', (select count(*) from public.follows where follower_id = p.id and status = 'accepted'),
|
||||
'visible', public.can_view(p.id)
|
||||
);
|
||||
if public.can_view(p.id) then
|
||||
res := res || jsonb_build_object(
|
||||
'stats', jsonb_build_object(
|
||||
'finished', (select count(*) from public.items where user_id = p.id and not deleted and data->>'status' = 'termine')
|
||||
),
|
||||
'top', (
|
||||
select coalesce(jsonb_agg(public.public_item(data) order by data->'top'->>'category', (data->'top'->>'rank')), '[]'::jsonb)
|
||||
from public.items i
|
||||
where i.user_id = p.id and not i.deleted and jsonb_typeof(i.data->'top') = 'object'
|
||||
and coalesce(
|
||||
(select s.data->'topCategories' ? (i.data->'top'->>'category')
|
||||
from public.settings s where s.user_id = p.id and jsonb_typeof(s.data->'topCategories') = 'array'),
|
||||
true)
|
||||
),
|
||||
'recent', (
|
||||
select coalesce(jsonb_agg(public.public_item(s.data) order by s.k desc nulls last), '[]'::jsonb)
|
||||
from (
|
||||
select data, coalesce(data->>'endDate', data->>'startDate') as k
|
||||
from public.items
|
||||
where user_id = p.id and not deleted and data->>'status' = 'termine'
|
||||
order by k desc nulls last limit 5
|
||||
) s
|
||||
),
|
||||
'watching', (
|
||||
select coalesce(jsonb_agg(public.public_item(s.data) order by s.k desc nulls last), '[]'::jsonb)
|
||||
from (
|
||||
select data, coalesce(data->>'startDate', left(data->>'updatedAt', 10)) as k
|
||||
from public.items
|
||||
where user_id = p.id and not deleted and data->>'status' = 'en_cours'
|
||||
order by k desc nulls last limit 8
|
||||
) s
|
||||
)
|
||||
);
|
||||
end if;
|
||||
return res;
|
||||
end;
|
||||
$$;
|
||||
revoke execute on function public.get_profile(text) from public, anon;
|
||||
grant execute on function public.get_profile(text) to authenticated;
|
||||
Reference in new issue
Block a user