diff --git a/CLAUDE.md b/CLAUDE.md index 4571d5c..08522fc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -95,3 +95,4 @@ npm run build # build de prod - **Langue automatique (2 déc. 2026)** : `detectLang()` (`src/i18n/index.ts`) suit la langue du téléphone si Bobinoo la parle (parmi plusieurs, celle du pays du fuseau horaire), sinon l'anglais. Le pays ne s'impose plus (un anglophone à Paris lit en anglais). Le pays sert toujours aux plateformes de streaming et aux sorties (`detectRegion`). Un choix fait à la main dans Réglages → Langue reste prioritaire. - **Recadrage photo de profil / bannière (2 déc. 2026)** : `components/social/ImageCropper.tsx` (glisser, pincer, molette, curseur, flèches du clavier ; l'image couvre toujours le cadre), sortie JPEG sans métadonnées via `cropToJpeg` (`lib/image.ts`) : 400 × 400 pour la photo, 1500 × 500 pour la bannière. Ouvert par `EditProfile` après le choix d'une photo. - **Bilan de l'année (2 déc. 2026)** : calcul dans `lib/recap.ts` (`yearRecap`, tout sur l'appareil, mêmes chiffres que la page Stats pour l'année), pages type story dans `components/YearRecap.tsx`, entrées dans `components/RecapEntry.tsx` : bouton « Mon année » sur la page Stats (année filtrée, sinon l'année en cours) et carte sur l'accueil en décembre (année en cours) et janvier (année passée) dès 3 titres terminés, masquable (clé `azuucine:recap-hint-`). Image à partager : `renderRecapCard` dans `lib/shareCard.ts`. +- **Profil public (2 déc. 2026)** : lien `bobinoo.org/@pseudo` (`profileLink`, `profileFromPath` dans `lib/cloud/social.ts`). Connecté : le profil s'ouvre normalement. Sans compte : mode découverte le temps de la visite (`Root.tsx`, rien n'est retenu) et `ProfileView` en mode `guest`, qui lit `public_profile` (seule fonction ouverte à `anon`, voir `docs/database.md`) ; pas de bibliothèque complète, « S'abonner » et « Rejoindre Bobinoo » ouvrent la demande de compte. Opt-in : `profiles.public_link`, interrupteur « Profil visible sans compte » dans `EditProfile` (sans effet si le compte est privé). nginx sert `index.html` pour `/@pseudo` avec `X-Robots-Tag: noindex` (`deploy/nginx/site.conf`), le service worker aussi (`navigateFallbackAllowlist`). Les anciens liens `#/u/pseudo` marchent toujours. diff --git a/deploy/nginx/site.conf b/deploy/nginx/site.conf index baf7ef7..e01c733 100644 --- a/deploy/nginx/site.conf +++ b/deploy/nginx/site.conf @@ -38,6 +38,15 @@ server { try_files $uri =404; } + # Lien de profil (bobinoo.org/@pseudo) : c'est l'app qui l'affiche. Pas d'indexation par les moteurs de recherche : + # un profil rendu public sert à être partagé par lien, pas à sortir dans Google. + location ~ "^/@[A-Za-z0-9_]{3,20}/?$" { + include /srv/bobinoo/current/nginx/security-headers.conf; + add_header Cache-Control "public, max-age=0, must-revalidate" always; + add_header X-Robots-Tag "noindex, nofollow" always; + try_files /index.html =404; + } + location / { include /srv/bobinoo/current/nginx/security-headers.conf; add_header Cache-Control "public, max-age=0, must-revalidate" always; diff --git a/docs/database.md b/docs/database.md index 19b8cd4..e0512ee 100644 --- a/docs/database.md +++ b/docs/database.md @@ -19,6 +19,11 @@ système de Postgres et de Supabase. Les fiches (`items`) pèsent ~0,5 Mo pour 2 (`20261201130000_mfa_everywhere.sql` : bloquer, supprimer un commentaire, gérer une liste partagée, `get_profile`, photos de profil dans le stockage). Toute nouvelle fonction appelable par l'app doit vérifier `azuu_mfa_ok()` (directement ou via `can_view`, `azuu_me_active`, `azuu_sl_member`, `azuu_sl_owner`). + **Seule exception** : `public_profile(p_username)`, ouverte sans compte (rôle `anon`) pour le lien + bobinoo.org/@pseudo. Elle ne renvoie un profil que si la personne a activé `profiles.public_link` (désactivé par + défaut) et que le compte n'est ni privé ni suspendu, réduit au strict nécessaire (`azuu_public_item_min` : titre, + affiche, type, année, note, genres, Top 5 ; ni avis, ni dates, ni notes perso). Sinon `null`, que le pseudo + existe ou non (`20261202120000_public_profile_link.sql`). ## Tables diff --git a/public/privacy.html b/public/privacy.html index c9b215c..66b27a2 100644 --- a/public/privacy.html +++ b/public/privacy.html @@ -35,6 +35,7 @@ @@ -80,7 +81,7 @@

Privacy policy (English summary)

-

Bobinoo is a free, ad-free personal watch journal published by Romain Dacet (data controller, contact: contact@bobinoo.org). It works without an account (everything stays on your device). With an account, it stores your email (and your name if you sign in with Google), your library, ratings, reviews, profile, follows and emoji reactions, to provide the service (contract). Your email is never shown to other users; your profile is visible to signed-in users unless you make your account private. Data is hosted by Supabase in the EU (Ireland); the site files are served, and account emails (address confirmation, password reset) sent from bobinoo.org, by OVH (France). Title data and posters come from TMDB and AniList, which see your IP address when your browser loads their images, but never your account data. No cookies, no trackers, no ads, no marketing emails, nothing sold; on-device storage is strictly necessary. Data is kept while your account exists and deleted immediately and completely when you delete it. You must be 13 or older, with a parent's consent if under 15. You can access, correct, export or delete your data from Settings, contact the publisher for any other request, and complain to the CNIL.

+

Bobinoo is a free, ad-free personal watch journal published by Romain Dacet (data controller, contact: contact@bobinoo.org). It works without an account (everything stays on your device). With an account, it stores your email (and your name if you sign in with Google), your library, ratings, reviews, profile, follows and emoji reactions, to provide the service (contract). Your email is never shown to other users; your profile is visible to signed-in users unless you make your account private, and to anyone with your bobinoo.org/@username link only if you turn on “Profile visible without an account” (off by default; your reviews and full library stay members-only). Data is hosted by Supabase in the EU (Ireland); the site files are served, and account emails (address confirmation, password reset) sent from bobinoo.org, by OVH (France). Title data and posters come from TMDB and AniList, which see your IP address when your browser loads their images, but never your account data. No cookies, no trackers, no ads, no marketing emails, nothing sold; on-device storage is strictly necessary. Data is kept while your account exists and deleted immediately and completely when you delete it. You must be 13 or older, with a parent's consent if under 15. You can access, correct, export or delete your data from Settings, contact the publisher for any other request, and complain to the CNIL.

diff --git a/src/Root.tsx b/src/Root.tsx index 7afbd5a..5e51735 100644 --- a/src/Root.tsx +++ b/src/Root.tsx @@ -4,6 +4,7 @@ import AuthScreen, { MfaScreen, NewPasswordScreen } from './components/AuthScree import GuestPrompt, { GuestBanner } from './components/guest/GuestPrompt' import { consumeAuthRedirect, getSession, hasOAuthRedirect, knownMfa, onSessionChange, pendingMfaFactor, sessionAal, type Session } from './lib/cloud/auth' import { cloudEnabled } from './lib/cloud/config' +import { profileFromPath } from './lib/cloud/social' import { setScope } from './lib/scope' import { MediaProvider } from './store' @@ -36,7 +37,9 @@ export default function Root() { cloudEnabled && (/(^#|&)(access_token|error)=/.test(location.hash) || hasOAuthRedirect()) ? 'checking' : 'none', ) const [notice, setNotice] = useState() - const [guest, setGuest] = useState(readGuest) + // Lien de profil (bobinoo.org/@pseudo) ouvert sans être connecté : mode découverte, le temps de la visite + // (rien n'est retenu : au prochain lancement, l'écran de connexion revient) + const [guest, setGuest] = useState(() => readGuest() || (cloudEnabled && !getSession() && !!profileFromPath())) const [ask, setAsk] = useState(false) // Écran de connexion demandé depuis le mode découverte (« Se connecter » / « Créer un compte ») const [authMode, setAuthMode] = useState<'login' | 'signup'>('login') diff --git a/src/components/TopFive.tsx b/src/components/TopFive.tsx index 0473691..44c661c 100644 --- a/src/components/TopFive.tsx +++ b/src/components/TopFive.tsx @@ -90,7 +90,8 @@ export default function TopFive({ onOpen, items: others }: { onOpen: (item: Medi ) } > - {t('top.title')} 5 + {/* « Mes Top 5 » pour le mien ; « Top 5 » pour celui d'un autre profil */} + {readOnly ? t('social.top5') : <>{t('top.title')} 5} {/* Choix de la catégorie */} diff --git a/src/components/social/EditProfile.tsx b/src/components/social/EditProfile.tsx index 74be85d..e3e9731 100644 --- a/src/components/social/EditProfile.tsx +++ b/src/components/social/EditProfile.tsx @@ -1,4 +1,4 @@ -import { Camera, ImagePlus, Loader2, Lock, Trash2 } from 'lucide-react' +import { Camera, Globe, ImagePlus, Loader2, Lock, Trash2 } from 'lucide-react' import { useEffect, useRef, useState } from 'react' import { t } from '../../i18n' import { deleteProfileImage, updateProfile, uploadProfileImage, USERNAME_RE, type ProfilePatch } from '../../lib/cloud/social' @@ -9,13 +9,14 @@ import ImageCropper from './ImageCropper' import Sheet from './Sheet' import { useSocial } from './SocialProvider' -/** Modifier mon profil : photo, bannière, nom, pseudo, bio, compte privé. */ +/** Modifier mon profil : photo, bannière, nom, pseudo, bio, compte privé, lien public. */ export default function EditProfile({ onClose }: { onClose: () => void }) { const { me, refresh } = useSocial() const [displayName, setDisplayName] = useState(me?.displayName ?? '') const [username, setUsername] = useState(me?.username ?? '') const [bio, setBio] = useState(me?.bio ?? '') const [isPrivate, setIsPrivate] = useState(me?.isPrivate ?? false) + const [publicLink, setPublicLink] = useState(me?.publicLink ?? false) const [avatar, setAvatar] = useState<{ blob?: Blob; preview?: string; removed?: boolean }>({ preview: me?.avatarUrl }) const [banner, setBanner] = useState<{ blob?: Blob; preview?: string; removed?: boolean }>({ preview: me?.bannerUrl }) const [saving, setSaving] = useState(false) @@ -73,6 +74,7 @@ export default function EditProfile({ onClose }: { onClose: () => void }) { if (cleanUsername !== me.username) patch.username = cleanUsername if (bio.trim() !== me.bio) patch.bio = bio.trim() if (isPrivate !== me.isPrivate) patch.is_private = isPrivate + if (publicLink !== !!me.publicLink) patch.public_link = publicLink if (avatar.blob) { patch.avatar_url = await uploadProfileImage('avatar', avatar.blob) uploaded.push(patch.avatar_url) @@ -186,6 +188,27 @@ export default function EditProfile({ onClose }: { onClose: () => void }) { + {/* Lien bobinoo.org/@pseudo ouvert sans compte : sans effet tant que le compte est privé */} + + {error && (

{error} diff --git a/src/components/social/ProfileView.tsx b/src/components/social/ProfileView.tsx index 0ccfa89..a778c15 100644 --- a/src/components/social/ProfileView.tsx +++ b/src/components/social/ProfileView.tsx @@ -1,7 +1,7 @@ import { Ban, Check, Loader2, Lock, Share2, Star, UserCheck, UserPlus } from 'lucide-react' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { fmtNumber, t } from '../../i18n' -import { follow, getProfile, getProfileItems, PROFILE_ITEMS_PAGE, profileLink, unfollow, type Profile } from '../../lib/cloud/social' +import { follow, getProfile, getProfileItems, getPublicProfile, PROFILE_ITEMS_PAGE, profileLink, unfollow, type Profile } from '../../lib/cloud/social' import { STATUSES, TOP_CATEGORIES } from '../../lib/constants' import { cx, formatRating } from '../../lib/utils' import { useMedia } from '../../store' @@ -50,10 +50,14 @@ function Stat({ value, label, onClick }: { value?: number; label: string; onClic ) } -/** Page de profil (la mienne ou celle d'un autre). */ -export default function ProfileView({ username, onClose }: { username: string; onClose: () => void }) { +/** + * Page de profil (la mienne ou celle d'un autre). + * `guest` : ouverte sans compte depuis un lien bobinoo.org/@pseudo. Seulement la version publique du profil + * (si la personne l'a activée), et chaque geste (suivre, voir la bibliothèque) propose de créer un compte. + */ +export default function ProfileView({ username, onClose, guest = false }: { username: string; onClose: () => void; guest?: boolean }) { const social = useSocial() - const { settings, items: myItems } = useMedia() + const { settings, items: myItems, requestAccount } = useMedia() // Mon profil : affiché tout de suite avec ce qu'on a déjà, puis rechargé const [profile, setProfile] = useState(() => (social.me?.username === username ? social.me : undefined)) const [error, setError] = useState() @@ -62,7 +66,7 @@ export default function ProfileView({ username, onClose }: { username: string; o const [confirmUnfollow, setConfirmUnfollow] = useState(false) const [toast, setToast] = useState() const [confirmBlock, setConfirmBlock] = useState(false) - const { isBlocked } = useBlocked(!!profile && !profile.isMe) + const { isBlocked } = useBlocked(!guest && !!profile && !profile.isMe) const blocked = !!profile && !profile.isMe && isBlocked(profile.id) /** `reload` : rechargement après une action (s'abonner, bloquer…) — en cas d'échec, on garde le profil affiché. */ @@ -70,7 +74,7 @@ export default function ProfileView({ username, onClose }: { username: string; o async (reload = false) => { if (!reload) setError(undefined) try { - const next = await getProfile(username) + const next = await (guest ? getPublicProfile(username) : getProfile(username)) if (reload) setError(undefined) setProfile(next) } catch (e) { @@ -79,7 +83,7 @@ export default function ProfileView({ username, onClose }: { username: string; o setProfile(null) } }, - [username], + [username, guest], ) useEffect(() => { @@ -104,11 +108,15 @@ export default function ProfileView({ username, onClose }: { username: string; o const share = async () => { if (!profile) return const url = profileLink(profile.username) + // Mon lien, pas encore public : il ne s'ouvrira que pour les membres connectés (on le dit, sans bloquer le partage) + const membersOnly = profile.isMe && !profile.publicLink try { - if (navigator.share && window.matchMedia?.('(pointer: coarse)').matches) await navigator.share({ title: profile.displayName, url }) - else { + if (navigator.share && window.matchMedia?.('(pointer: coarse)').matches) { + await navigator.share({ title: profile.displayName, url }) + if (membersOnly) setToast(t('social.linkMembersOnly')) + } else { await navigator.clipboard.writeText(url) - setToast(t('social.linkCopied')) + setToast(membersOnly ? `${t('social.linkCopied')} ${t('social.linkMembersOnly')}` : t('social.linkCopied')) } } catch { /* partage annulé */ @@ -190,6 +198,8 @@ export default function ProfileView({ username, onClose }: { username: string; o // Mon profil : l'onglet Top 5 est toujours là (c'est ici qu'on le modifie) ; un autre : seulement s'il en a un const showTop = !!profile && (profile.isMe ? settings.topCategories.length > 0 : topByCategory.length > 0) + // Sans compte : pas de bibliothèque complète (réservée aux membres) + const tabs = (['profile', ...(showTop ? ['top'] : []), ...(guest ? [] : ['library'])] as ('profile' | 'top' | 'library')[]) return ( ) : profile === null ? (

- + {guest && !error ? ( + <> + + + + ) : ( + + )}
) : ( <> @@ -227,6 +246,10 @@ export default function ProfileView({ username, onClose }: { username: string; o + ) : guest ? ( + ) : (
{blocked ? ( @@ -288,8 +311,8 @@ export default function ProfileView({ username, onClose }: { username: string; o
- social.openFollowList(profile, 'followers') : undefined} /> - social.openFollowList(profile, 'following') : undefined} /> + social.openFollowList(profile, 'followers') : undefined} /> + social.openFollowList(profile, 'following') : undefined} />
{profile.isMe && social.requests.length > 0 && ( @@ -307,8 +330,8 @@ export default function ProfileView({ username, onClose }: { username: string; o
) : ( <> -
- {(showTop ? (['profile', 'top', 'library'] as const) : (['profile', 'library'] as const)).map((v) => ( +
+ {tabs.map((v) => (
{tab === 'profile' ? ( - + <> + + {guest && ( +
+

{t('social.publicCtaTitle')}

+

{t('social.publicCtaText', { name: profile.displayName })}

+ +
+ )} + ) : tab === 'top' ? ( ) : ( diff --git a/src/components/social/SocialProvider.tsx b/src/components/social/SocialProvider.tsx index 8b31b64..5ec0798 100644 --- a/src/components/social/SocialProvider.tsx +++ b/src/components/social/SocialProvider.tsx @@ -1,6 +1,6 @@ -import { createContext, Suspense, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from 'react' +import { createContext, Suspense, useCallback, useContext, useEffect, useMemo, useRef, useState, type ReactNode } from 'react' import { lazyPreload } from '../../lib/lazyPreload' -import { cachedMyProfile, getFollowRequests, getMyProfile, unreadNotifications, type Profile, type ProfileCard } from '../../lib/cloud/social' +import { cachedMyProfile, getFollowRequests, getMyProfile, profileFromPath, unreadNotifications, type Profile, type ProfileCard } from '../../lib/cloud/social' import { useMedia } from '../../store' import type { MediaItem } from '../../types' import type { PeekOwner } from './ItemPeek' @@ -97,7 +97,7 @@ export function SocialProvider({ /** Ouvre la fiche d'un titre pas encore dans ma bibliothèque */ onOpenSeed?: (seed: SearchResult) => void }) { - const { account, items } = useMedia() + const { account, items, guest } = useMedia() const enabled = !!account // Profil gardé sur l'appareil : photo et pseudo tout de suite, sans attendre le serveur const [me, setMe] = useState(() => (enabled ? cachedMyProfile() : null)) @@ -161,28 +161,34 @@ export function SocialProvider({ const push = useCallback((o: Overlay) => setStack((s) => [...s.slice(-8), { ...o, uid: ++overlayUid }]), []) const close = useCallback((uid: number) => setStack((s) => s.filter((x) => x.uid !== uid)), []) - // Lien partagé « #/u/pseudo » + // Lien partagé « bobinoo.org/@pseudo » (ou l'ancien « #/u/pseudo ») : le profil s'ouvre par-dessus l'accueil. + // Sans compte (mode découverte), c'est la version publique, si la personne l'a activée. useEffect(() => { - if (!enabled) return + if (!enabled && !guest) return const check = () => { - const m = location.hash.match(/^#\/u\/([a-z0-9_]{3,20})$/i) - if (!m) return - history.replaceState(null, '', `${location.pathname}${location.search}#/home`) - push({ kind: 'profile', username: m[1].toLowerCase() }) + const name = profileFromPath() ?? location.hash.match(/^#\/u\/([a-z0-9_]{3,20})$/i)?.[1].toLowerCase() + if (!name) return + history.replaceState(null, '', `/${location.search}#/home`) + push({ kind: 'profile', username: name }) } check() window.addEventListener('hashchange', check) return () => window.removeEventListener('hashchange', check) - }, [enabled, push]) + }, [enabled, guest, push]) const openItem = useCallback( (item: MediaItem, owner?: PeekOwner) => { + // Sans compte (profil public) : la fiche du catalogue, en lecture seule + if (!enabled) { + if (item.externalId) void openTitleRef.current({ externalId: item.externalId, title: item.title, poster: item.poster, type: item.type, year: item.year, addedAt: '', addedBy: null }) + return + } const mine = !owner || owner.username === me?.username const local = mine ? items.find((i) => i.id === item.id) : undefined if (local) onOpenOwnItem(local) else setPeeked({ item, owner }) }, - [items, me?.username, onOpenOwnItem], + [enabled, items, me?.username, onOpenOwnItem], ) const openTitle = useCallback( @@ -208,6 +214,8 @@ export function SocialProvider({ }, [items, onOpenOwnItem, onOpenSeed], ) + const openTitleRef = useRef(openTitle) + openTitleRef.current = openTitle const api = useMemo( () => ({ @@ -235,11 +243,10 @@ export function SocialProvider({ return ( {/* Les écrans sociaux sont placés avant l'app : une fiche ouverte depuis un profil passe au-dessus */} - {enabled && - stack.map((o) => ( + {(enabled ? stack : guest ? stack.filter((o) => o.kind === 'profile') : []).map((o) => ( {o.kind === 'profile' ? ( - close(o.uid)} /> + close(o.uid)} /> ) : o.kind === 'search' ? ( close(o.uid)} /> ) : o.kind === 'edit' ? ( diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts index 7bf2ead..9bb7839 100644 --- a/src/i18n/locales/ar.ts +++ b/src/i18n/locales/ar.ts @@ -1226,6 +1226,15 @@ const dict: Translations = { "recap.prev": "السابق", "recap.cardTitle": "سنتي", "recap.shareTitle": "سنتي {year} على Bobinoo", + "social.publicLink": "ملف ظاهر بدون حساب", + "social.publicLinkHint": "رابطك {link} يُفتح أيضًا بدون حساب: الصورة والنبذة وأفضل 5 وما تشاهده الآن وآخر ما شاهدته، مع تقييماتك. آراؤك ومكتبتك الكاملة تبقى للأعضاء فقط.", + "social.publicLinkPrivate": "حسابك خاص: حتى مع الرابط، لا يرى ملفك إلا متابعوك.", + "social.linkMembersOnly": "حاليًا يُفتح فقط للأعضاء المسجّلين دخولهم. لمشاركته مع الجميع، فعّل «ملف ظاهر بدون حساب» في «تعديل الملف الشخصي».", + "social.publicNotFound": "لم يُعثر على الملف", + "social.publicNotFoundHint": "هذا الملف غير موجود، أو لا يراه إلا الأعضاء المسجّلون دخولهم.", + "social.publicJoin": "انضم إلى Bobinoo", + "social.publicCtaTitle": "تريد رؤية مكتبته كاملة؟", + "social.publicCtaText": "أنشئ حسابك لمتابعة {name} ورؤية كل عناوينه وتنظيم قائمتك الخاصة. مجانًا.", } export default dict diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 00449f8..cc6dbd9 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "Zurück", "recap.cardTitle": "Mein Jahr", "recap.shareTitle": "Mein Jahr {year} auf Bobinoo", + "social.publicLink": "Profil ohne Konto sichtbar", + "social.publicLinkHint": "Dein Link {link} öffnet sich auch ohne Konto: Foto, Bio, Top 5, was du gerade schaust und deine zuletzt gesehenen Titel, mit deinen Bewertungen. Deine Meinungen und deine ganze Bibliothek bleiben Mitgliedern vorbehalten.", + "social.publicLinkPrivate": "Dein Konto ist privat: Auch mit dem Link sehen nur deine Follower dein Profil.", + "social.linkMembersOnly": "Im Moment öffnet er sich nur für angemeldete Mitglieder. Um ihn mit allen zu teilen, aktiviere „Profil ohne Konto sichtbar“ unter „Profil bearbeiten“.", + "social.publicNotFound": "Profil nicht gefunden", + "social.publicNotFoundHint": "Dieses Profil gibt es nicht, oder nur angemeldete Mitglieder können es sehen.", + "social.publicJoin": "Bobinoo beitreten", + "social.publicCtaTitle": "Lust, die ganze Bibliothek zu sehen?", + "social.publicCtaText": "Erstelle dein Konto, um {name} zu folgen, alle Titel zu sehen und deine eigene Liste zu führen. Es ist kostenlos.", } export default dict diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index af5fd1a..4d0e406 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "Previous", "recap.cardTitle": "My year", "recap.shareTitle": "My {year} on Bobinoo", + "social.publicLink": "Profile visible without an account", + "social.publicLinkHint": "Your link {link} also opens without an account: photo, bio, Top 5, what you’re watching and your latest titles, with your ratings. Your reviews and full library stay members-only.", + "social.publicLinkPrivate": "Your account is private: even with the link, only your followers can see your profile.", + "social.linkMembersOnly": "For now, it only opens for signed-in members. To share it with everyone, turn on “Profile visible without an account” in “Edit profile”.", + "social.publicNotFound": "Profile not found", + "social.publicNotFoundHint": "This profile doesn’t exist, or only signed-in members can see it.", + "social.publicJoin": "Join Bobinoo", + "social.publicCtaTitle": "Want to see their whole library?", + "social.publicCtaText": "Create your account to follow {name}, see all their titles and keep your own list. It’s free.", } export default dict diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index def76c5..3b2ff84 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "Anterior", "recap.cardTitle": "Mi año", "recap.shareTitle": "Mi {year} en Bobinoo", + "social.publicLink": "Perfil visible sin cuenta", + "social.publicLinkHint": "Tu enlace {link} también se abre sin cuenta: foto, bio, Top 5, lo que estás viendo y tus últimos títulos vistos, con tus notas. Tus opiniones y tu biblioteca completa siguen siendo solo para miembros.", + "social.publicLinkPrivate": "Tu cuenta es privada: aunque tengan el enlace, solo tus seguidores ven tu perfil.", + "social.linkMembersOnly": "Por ahora solo se abre para miembros con sesión iniciada. Para compartirlo con todo el mundo, activa «Perfil visible sin cuenta» en «Editar perfil».", + "social.publicNotFound": "Perfil no encontrado", + "social.publicNotFoundHint": "Este perfil no existe, o solo pueden verlo los miembros con sesión iniciada.", + "social.publicJoin": "Unirme a Bobinoo", + "social.publicCtaTitle": "¿Quieres ver toda su biblioteca?", + "social.publicCtaText": "Crea tu cuenta para seguir a {name}, ver todos sus títulos y llevar tu propia lista. Es gratis.", } export default dict diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index f947343..f8dcf87 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -1073,6 +1073,15 @@ const dict = { "recap.prev": "Précédent", "recap.cardTitle": "Mon année", "recap.shareTitle": "Mon année {year} sur Bobinoo", + "social.publicLink": "Profil visible sans compte", + "social.publicLinkHint": "Ton lien {link} s’ouvre aussi sans compte : photo, bio, Top 5, ce que tu regardes et tes derniers titres vus, avec tes notes. Tes avis et ta bibliothèque complète restent réservés aux membres.", + "social.publicLinkPrivate": "Ton compte est privé : même avec le lien, seuls tes abonnés voient ton profil.", + "social.linkMembersOnly": "Pour l’instant, il ne s’ouvre que pour les membres connectés. Pour le partager à tout le monde, active « Profil visible sans compte » dans « Modifier le profil ».", + "social.publicNotFound": "Profil introuvable", + "social.publicNotFoundHint": "Ce profil n’existe pas, ou il n’est visible que par les membres connectés.", + "social.publicJoin": "Rejoindre Bobinoo", + "social.publicCtaTitle": "Envie de voir toute sa bibliothèque ?", + "social.publicCtaText": "Crée ton compte pour suivre {name}, voir tous ses titres et tenir ta propre liste. C’est gratuit.", } export default dict diff --git a/src/i18n/locales/hi.ts b/src/i18n/locales/hi.ts index 94f73c4..bd76add 100644 --- a/src/i18n/locales/hi.ts +++ b/src/i18n/locales/hi.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "पीछे", "recap.cardTitle": "मेरा साल", "recap.shareTitle": "Bobinoo पर मेरा {year}", + "social.publicLink": "बिना अकाउंट के दिखने वाली प्रोफ़ाइल", + "social.publicLinkHint": "आपका लिंक {link} बिना अकाउंट के भी खुलता है: फ़ोटो, बायो, टॉप 5, आप अभी क्या देख रहे हैं और हाल में देखे टाइटल, आपकी रेटिंग के साथ। आपके रिव्यू और पूरी लाइब्रेरी सिर्फ़ सदस्यों के लिए रहती है।", + "social.publicLinkPrivate": "आपका अकाउंट प्राइवेट है: लिंक होने पर भी आपकी प्रोफ़ाइल सिर्फ़ आपके फ़ॉलोअर देख सकते हैं।", + "social.linkMembersOnly": "अभी यह सिर्फ़ लॉग इन किए सदस्यों के लिए खुलता है। सबके साथ शेयर करने के लिए “प्रोफ़ाइल एडिट करें” में “बिना अकाउंट के दिखने वाली प्रोफ़ाइल” चालू करें।", + "social.publicNotFound": "प्रोफ़ाइल नहीं मिली", + "social.publicNotFoundHint": "यह प्रोफ़ाइल मौजूद नहीं है, या इसे सिर्फ़ लॉग इन किए सदस्य देख सकते हैं।", + "social.publicJoin": "Bobinoo से जुड़ें", + "social.publicCtaTitle": "पूरी लाइब्रेरी देखनी है?", + "social.publicCtaText": "{name} को फ़ॉलो करने, सारे टाइटल देखने और अपनी लिस्ट बनाने के लिए अपना अकाउंट बनाएँ। यह मुफ़्त है।", } export default dict diff --git a/src/i18n/locales/id.ts b/src/i18n/locales/id.ts index 2ea9859..ded8fac 100644 --- a/src/i18n/locales/id.ts +++ b/src/i18n/locales/id.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "Sebelumnya", "recap.cardTitle": "Tahunku", "recap.shareTitle": "Tahun {year}-ku di Bobinoo", + "social.publicLink": "Profil terlihat tanpa akun", + "social.publicLinkHint": "Tautanmu {link} juga bisa dibuka tanpa akun: foto, bio, Top 5, yang sedang kamu tonton, dan judul terakhir yang kamu tonton, lengkap dengan nilaimu. Ulasan dan seluruh koleksimu tetap hanya untuk anggota.", + "social.publicLinkPrivate": "Akunmu privat: meski punya tautannya, hanya pengikutmu yang bisa melihat profilmu.", + "social.linkMembersOnly": "Untuk sekarang, tautan ini hanya terbuka bagi anggota yang sudah masuk. Agar bisa dibagikan ke semua orang, aktifkan “Profil terlihat tanpa akun” di “Edit profil”.", + "social.publicNotFound": "Profil tidak ditemukan", + "social.publicNotFoundHint": "Profil ini tidak ada, atau hanya bisa dilihat anggota yang sudah masuk.", + "social.publicJoin": "Gabung ke Bobinoo", + "social.publicCtaTitle": "Mau lihat seluruh koleksinya?", + "social.publicCtaText": "Buat akunmu untuk mengikuti {name}, melihat semua judulnya, dan menyusun daftarmu sendiri. Gratis.", } export default dict diff --git a/src/i18n/locales/it.ts b/src/i18n/locales/it.ts index c057417..41ba64b 100644 --- a/src/i18n/locales/it.ts +++ b/src/i18n/locales/it.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "Indietro", "recap.cardTitle": "Il mio anno", "recap.shareTitle": "Il mio {year} su Bobinoo", + "social.publicLink": "Profilo visibile senza account", + "social.publicLinkHint": "Il tuo link {link} si apre anche senza account: foto, bio, Top 5, cosa stai guardando e gli ultimi titoli visti, con i tuoi voti. Le tue opinioni e la libreria completa restano riservate ai membri.", + "social.publicLinkPrivate": "Il tuo account è privato: anche con il link, solo i tuoi follower vedono il tuo profilo.", + "social.linkMembersOnly": "Per ora si apre solo per i membri che hanno effettuato l’accesso. Per condividerlo con tutti, attiva «Profilo visibile senza account» in «Modifica profilo».", + "social.publicNotFound": "Profilo non trovato", + "social.publicNotFoundHint": "Questo profilo non esiste, oppure è visibile solo ai membri che hanno effettuato l’accesso.", + "social.publicJoin": "Unisciti a Bobinoo", + "social.publicCtaTitle": "Vuoi vedere tutta la sua libreria?", + "social.publicCtaText": "Crea il tuo account per seguire {name}, vedere tutti i suoi titoli e tenere la tua lista. È gratis.", } export default dict diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts index 95f88cd..c76b55e 100644 --- a/src/i18n/locales/ja.ts +++ b/src/i18n/locales/ja.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "前へ", "recap.cardTitle": "わたしの1年", "recap.shareTitle": "Bobinoo でふり返る{year}年", + "social.publicLink": "アカウントなしでも見られるプロフィール", + "social.publicLinkHint": "リンク {link} はアカウントがなくても開けます。表示されるのは写真、自己紹介、トップ5、視聴中の作品、最近見た作品と評価です。レビューとライブラリ全体はメンバーだけに公開されます。", + "social.publicLinkPrivate": "アカウントが非公開です。リンクがあっても、プロフィールを見られるのはフォロワーだけです。", + "social.linkMembersOnly": "今はログインしたメンバーだけが開けます。誰にでも共有するには、「プロフィールを編集」で「アカウントなしでも見られるプロフィール」をオンにしてください。", + "social.publicNotFound": "プロフィールが見つかりません", + "social.publicNotFoundHint": "このプロフィールは存在しないか、ログインしたメンバーだけが見られます。", + "social.publicJoin": "Bobinoo に参加", + "social.publicCtaTitle": "ライブラリ全体を見てみる?", + "social.publicCtaText": "アカウントを作ると、{name} さんをフォローして全作品を見たり、自分のリストを作ったりできます。無料です。", } export default dict diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts index 47aeac5..e3c4bf0 100644 --- a/src/i18n/locales/ko.ts +++ b/src/i18n/locales/ko.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "이전", "recap.cardTitle": "나의 한 해", "recap.shareTitle": "Bobinoo로 돌아본 나의 {year}년", + "social.publicLink": "계정 없이 볼 수 있는 프로필", + "social.publicLinkHint": "{link} 링크는 계정이 없어도 열려요. 사진, 소개, 탑 5, 지금 보는 작품, 최근에 본 작품과 평점이 보여요. 감상과 전체 라이브러리는 회원만 볼 수 있어요.", + "social.publicLinkPrivate": "계정이 비공개예요. 링크가 있어도 프로필은 팔로워만 볼 수 있어요.", + "social.linkMembersOnly": "지금은 로그인한 회원만 열 수 있어요. 모두에게 공유하려면 ‘프로필 수정’에서 ‘계정 없이 볼 수 있는 프로필’을 켜세요.", + "social.publicNotFound": "프로필을 찾을 수 없어요", + "social.publicNotFoundHint": "이 프로필이 없거나, 로그인한 회원만 볼 수 있어요.", + "social.publicJoin": "Bobinoo 가입하기", + "social.publicCtaTitle": "라이브러리 전체를 보고 싶나요?", + "social.publicCtaText": "계정을 만들면 {name} 님을 팔로우하고, 모든 작품을 보고, 나만의 리스트를 만들 수 있어요. 무료예요.", } export default dict diff --git a/src/i18n/locales/nl.ts b/src/i18n/locales/nl.ts index 6a84aa7..3377b95 100644 --- a/src/i18n/locales/nl.ts +++ b/src/i18n/locales/nl.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "Vorige", "recap.cardTitle": "Mijn jaar", "recap.shareTitle": "Mijn {year} op Bobinoo", + "social.publicLink": "Profiel zichtbaar zonder account", + "social.publicLinkHint": "Je link {link} opent ook zonder account: foto, bio, Top 5, wat je nu kijkt en je laatst geziene titels, met je scores. Je reviews en je volledige bibliotheek blijven alleen voor leden.", + "social.publicLinkPrivate": "Je account is privé: ook met de link zien alleen je volgers je profiel.", + "social.linkMembersOnly": "Voorlopig opent hij alleen voor ingelogde leden. Wil je hem met iedereen delen, zet dan “Profiel zichtbaar zonder account” aan bij “Profiel bewerken”.", + "social.publicNotFound": "Profiel niet gevonden", + "social.publicNotFoundHint": "Dit profiel bestaat niet, of alleen ingelogde leden kunnen het zien.", + "social.publicJoin": "Word lid van Bobinoo", + "social.publicCtaTitle": "Zin om de hele bibliotheek te zien?", + "social.publicCtaText": "Maak een account om {name} te volgen, alle titels te zien en je eigen lijst bij te houden. Het is gratis.", } export default dict diff --git a/src/i18n/locales/pl.ts b/src/i18n/locales/pl.ts index b8db767..2d50bfd 100644 --- a/src/i18n/locales/pl.ts +++ b/src/i18n/locales/pl.ts @@ -1173,6 +1173,15 @@ const dict: Translations = { "recap.prev": "Wstecz", "recap.cardTitle": "Mój rok", "recap.shareTitle": "Mój rok {year} w Bobinoo", + "social.publicLink": "Profil widoczny bez konta", + "social.publicLinkHint": "Twój link {link} otwiera się też bez konta: zdjęcie, bio, Top 5, to, co teraz oglądasz, i ostatnio obejrzane tytuły, razem z ocenami. Twoje recenzje i cała biblioteka pozostają tylko dla użytkowników.", + "social.publicLinkPrivate": "Twoje konto jest prywatne: nawet z linkiem twój profil widzą tylko twoi obserwujący.", + "social.linkMembersOnly": "Na razie otwiera się tylko dla zalogowanych użytkowników. Aby udostępnić go wszystkim, włącz „Profil widoczny bez konta” w „Edytuj profil”.", + "social.publicNotFound": "Nie znaleziono profilu", + "social.publicNotFoundHint": "Ten profil nie istnieje albo widzą go tylko zalogowani użytkownicy.", + "social.publicJoin": "Dołącz do Bobinoo", + "social.publicCtaTitle": "Chcesz zobaczyć całą bibliotekę?", + "social.publicCtaText": "Załóż konto, aby obserwować {name}, widzieć wszystkie tytuły i prowadzić własną listę. To nic nie kosztuje.", } export default dict diff --git a/src/i18n/locales/pt.ts b/src/i18n/locales/pt.ts index 68aeb11..707df37 100644 --- a/src/i18n/locales/pt.ts +++ b/src/i18n/locales/pt.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "Anterior", "recap.cardTitle": "Meu ano", "recap.shareTitle": "Meu {year} no Bobinoo", + "social.publicLink": "Perfil visível sem conta", + "social.publicLinkHint": "Seu link {link} também abre sem conta: foto, bio, Top 5, o que você está assistindo e seus últimos títulos vistos, com suas notas. Suas opiniões e sua biblioteca completa continuam só para membros.", + "social.publicLinkPrivate": "Sua conta é privada: mesmo com o link, só seus seguidores veem seu perfil.", + "social.linkMembersOnly": "Por enquanto, ele só abre para membros conectados. Para compartilhar com todo mundo, ative “Perfil visível sem conta” em “Editar perfil”.", + "social.publicNotFound": "Perfil não encontrado", + "social.publicNotFoundHint": "Este perfil não existe, ou só membros conectados podem vê-lo.", + "social.publicJoin": "Entrar no Bobinoo", + "social.publicCtaTitle": "Quer ver toda a biblioteca?", + "social.publicCtaText": "Crie sua conta para seguir {name}, ver todos os títulos e montar sua própria lista. É grátis.", } export default dict diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index c84cdbe..7373810 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -1173,6 +1173,15 @@ const dict: Translations = { "recap.prev": "Назад", "recap.cardTitle": "Мой год", "recap.shareTitle": "Мой {year} год в Bobinoo", + "social.publicLink": "Профиль виден без аккаунта", + "social.publicLinkHint": "Твоя ссылка {link} открывается и без аккаунта: фото, описание, Топ 5, что ты смотришь сейчас и последние просмотренные тайтлы, с твоими оценками. Отзывы и вся библиотека доступны только участникам.", + "social.publicLinkPrivate": "Твой аккаунт закрыт: даже по ссылке профиль видят только твои подписчики.", + "social.linkMembersOnly": "Пока она открывается только для вошедших участников. Чтобы поделиться ею со всеми, включи «Профиль виден без аккаунта» в разделе «Изменить профиль».", + "social.publicNotFound": "Профиль не найден", + "social.publicNotFoundHint": "Такого профиля нет, или его видят только вошедшие участники.", + "social.publicJoin": "Присоединиться к Bobinoo", + "social.publicCtaTitle": "Хочешь увидеть всю библиотеку?", + "social.publicCtaText": "Создай аккаунт, чтобы подписаться на {name}, видеть все тайтлы и вести свой список. Это бесплатно.", } export default dict diff --git a/src/i18n/locales/th.ts b/src/i18n/locales/th.ts index 61cc00d..cfc3320 100644 --- a/src/i18n/locales/th.ts +++ b/src/i18n/locales/th.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "ก่อนหน้า", "recap.cardTitle": "ปีของฉัน", "recap.shareTitle": "ปี {year} ของฉันบน Bobinoo", + "social.publicLink": "โปรไฟล์ที่ดูได้โดยไม่ต้องมีบัญชี", + "social.publicLinkHint": "ลิงก์ {link} ของคุณเปิดได้แม้ไม่มีบัญชี: รูป ไบโอ ท็อป 5 เรื่องที่กำลังดู และเรื่องที่ดูล่าสุด พร้อมคะแนนของคุณ ส่วนรีวิวและคลังทั้งหมดของคุณยังเห็นได้เฉพาะสมาชิก", + "social.publicLinkPrivate": "บัญชีของคุณเป็นส่วนตัว: แม้มีลิงก์ ก็มีแค่ผู้ติดตามของคุณที่เห็นโปรไฟล์", + "social.linkMembersOnly": "ตอนนี้ลิงก์เปิดได้เฉพาะสมาชิกที่เข้าสู่ระบบ หากต้องการแชร์ให้ทุกคน ให้เปิด “โปรไฟล์ที่ดูได้โดยไม่ต้องมีบัญชี” ใน “แก้ไขโปรไฟล์”", + "social.publicNotFound": "ไม่พบโปรไฟล์", + "social.publicNotFoundHint": "ไม่มีโปรไฟล์นี้ หรือมีแค่สมาชิกที่เข้าสู่ระบบที่ดูได้", + "social.publicJoin": "เข้าร่วม Bobinoo", + "social.publicCtaTitle": "อยากดูคลังทั้งหมดไหม?", + "social.publicCtaText": "สร้างบัญชีเพื่อติดตาม {name} ดูทุกเรื่อง และจดรายการของคุณเอง ใช้ฟรี", } export default dict diff --git a/src/i18n/locales/tr.ts b/src/i18n/locales/tr.ts index a198422..6ab21bd 100644 --- a/src/i18n/locales/tr.ts +++ b/src/i18n/locales/tr.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "Geri", "recap.cardTitle": "Yılım", "recap.shareTitle": "Bobinoo’da {year} yılım", + "social.publicLink": "Hesapsız görünen profil", + "social.publicLinkHint": "{link} bağlantın hesabı olmayanlar için de açılır: fotoğraf, biyografi, Top 5, şu an izlediklerin ve son izlediğin yapımlar, puanlarınla birlikte. Yorumların ve kütüphanenin tamamı yalnızca üyelere açık kalır.", + "social.publicLinkPrivate": "Hesabın gizli: bağlantıyla bile profilini yalnızca takipçilerin görür.", + "social.linkMembersOnly": "Şimdilik yalnızca giriş yapmış üyeler için açılıyor. Herkesle paylaşmak için “Profili düzenle” bölümünde “Hesapsız görünen profil” seçeneğini aç.", + "social.publicNotFound": "Profil bulunamadı", + "social.publicNotFoundHint": "Bu profil yok ya da yalnızca giriş yapmış üyeler görebiliyor.", + "social.publicJoin": "Bobinoo’ya katıl", + "social.publicCtaTitle": "Kütüphanenin tamamını görmek ister misin?", + "social.publicCtaText": "{name} kişisini takip etmek, tüm yapımlarını görmek ve kendi listeni tutmak için hesabını oluştur. Ücretsiz.", } export default dict diff --git a/src/i18n/locales/vi.ts b/src/i18n/locales/vi.ts index a7e861a..e7a2787 100644 --- a/src/i18n/locales/vi.ts +++ b/src/i18n/locales/vi.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "Trước", "recap.cardTitle": "Năm của tôi", "recap.shareTitle": "Năm {year} của tôi trên Bobinoo", + "social.publicLink": "Hồ sơ xem được khi không có tài khoản", + "social.publicLinkHint": "Liên kết {link} của bạn mở được cả khi không có tài khoản: ảnh, giới thiệu, Top 5, phim bạn đang xem và những phim xem gần đây, kèm điểm của bạn. Nhận xét và toàn bộ thư viện vẫn chỉ dành cho thành viên.", + "social.publicLinkPrivate": "Tài khoản của bạn đang riêng tư: dù có liên kết, chỉ người theo dõi của bạn mới xem được hồ sơ.", + "social.linkMembersOnly": "Hiện liên kết chỉ mở được với thành viên đã đăng nhập. Để chia sẻ với mọi người, hãy bật “Hồ sơ xem được khi không có tài khoản” trong “Sửa hồ sơ”.", + "social.publicNotFound": "Không tìm thấy hồ sơ", + "social.publicNotFoundHint": "Hồ sơ này không tồn tại, hoặc chỉ thành viên đã đăng nhập mới xem được.", + "social.publicJoin": "Tham gia Bobinoo", + "social.publicCtaTitle": "Muốn xem toàn bộ thư viện?", + "social.publicCtaText": "Tạo tài khoản để theo dõi {name}, xem mọi phim và tự lập danh sách của riêng bạn. Miễn phí.", } export default dict diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index c4e0611..4bbf264 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -1071,6 +1071,15 @@ const dict: Translations = { "recap.prev": "上一页", "recap.cardTitle": "我的一年", "recap.shareTitle": "我在 Bobinoo 的 {year} 年", + "social.publicLink": "无需账号即可查看主页", + "social.publicLinkHint": "你的链接 {link} 无需账号也能打开:头像、简介、Top 5、正在看的和最近看完的作品,以及你的评分。你的短评和完整片库仍只对用户可见。", + "social.publicLinkPrivate": "你的账号是私密的:即使有链接,也只有你的关注者能看到你的主页。", + "social.linkMembersOnly": "目前只有已登录的用户能打开。想分享给所有人,请在“编辑主页”中开启“无需账号即可查看主页”。", + "social.publicNotFound": "找不到主页", + "social.publicNotFoundHint": "这个主页不存在,或只对已登录的用户可见。", + "social.publicJoin": "加入 Bobinoo", + "social.publicCtaTitle": "想看完整片库?", + "social.publicCtaText": "创建账号即可关注 {name}、查看全部作品并管理你自己的片单。免费使用。", } export default dict diff --git a/src/lib/cloud/api.ts b/src/lib/cloud/api.ts index dc1703d..65c4977 100644 --- a/src/lib/cloud/api.ts +++ b/src/lib/cloud/api.ts @@ -36,6 +36,19 @@ export async function cloudFetch(path: string, init: RequestInit = {}): Promise< throw new AuthError(t('auth.err.session')) } +/** Fonction de la base ouverte sans compte (profil public) : clé publique seulement, jamais de jeton. */ +export async function anonRpc(name: string, args: Record): Promise { + const res = await timedFetch(`${SUPABASE_URL}/rest/v1/rpc/${name}`, { + method: 'POST', + headers: { apikey: SUPABASE_ANON_KEY, 'Content-Type': 'application/json' }, + body: JSON.stringify(args), + credentials: 'omit', + referrerPolicy: 'no-referrer', + }) + if (!res.ok) throw new Error(t('social.err.server', { status: res.status })) + return res.json() +} + /** * Données publiques (catalogue TMDB, notes Trakt) : requête « simple », sans aucun en-tête. * Avec un en-tête (jeton, apikey), le navigateur envoie d'abord une pré-requête CORS, adresse par adresse : diff --git a/src/lib/cloud/social.ts b/src/lib/cloud/social.ts index 9f2c399..6419eb2 100644 --- a/src/lib/cloud/social.ts +++ b/src/lib/cloud/social.ts @@ -2,7 +2,7 @@ import { t } from '../../i18n' import type { MediaItem } from '../../types' import { normalizeItem } from '../backup' import { cleanText, isPlainObject, safeIso } from '../security' -import { cloudFetch } from './api' +import { anonRpc, cloudFetch } from './api' import { getSession } from './auth' import { SUPABASE_URL } from './config' @@ -36,6 +36,8 @@ export interface Profile extends ProfileCard { top: MediaItem[] recent: MediaItem[] watching: MediaItem[] + /** Mon profil seulement : le lien bobinoo.org/@pseudo s'ouvre aussi sans compte */ + publicLink?: boolean } export interface FeedEntry { @@ -106,6 +108,7 @@ function toProfile(raw: unknown): Profile | null { top: toItems(raw.top), recent: toItems(raw.recent), watching: toItems(raw.watching), + publicLink: raw.is_me === true ? raw.public_link === true : undefined, } } @@ -133,6 +136,19 @@ export async function getProfile(name: string): Promise { return toProfile(await rpc('get_profile', { p_username: clean })) } +/** + * Profil ouvert sans compte (lien bobinoo.org/@pseudo) : seulement si la personne a rendu son lien public. + * null aussi bien pour un pseudo inconnu que pour un profil réservé aux membres. + */ +export async function getPublicProfile(name: string): Promise { + const clean = name.trim().toLowerCase().replace(/^@/, '') + if (!USERNAME_RE.test(clean)) return null + const raw = await anonRpc('public_profile', { p_username: clean }) + if (!isPlainObject(raw)) return null + // Vu de l'extérieur : jamais « moi », aucune relation, tout ce qui est renvoyé est visible + return toProfile({ ...raw, is_me: false, follows_me: false, relation: 'none', is_private: false, visible: true }) +} + // Mon profil gardé sur l'appareil : affiché dès le lancement, puis rafraîchi en arrière-plan const meKey = (userId: string) => `azuucine:${userId}:me` @@ -348,6 +364,7 @@ export interface ProfilePatch { display_name?: string bio?: string is_private?: boolean + public_link?: boolean avatar_url?: string | null banner_url?: string | null } @@ -388,5 +405,10 @@ export async function deleteProfileImage(url?: string) { await cloudFetch(`/storage/v1/object/profile-media/${path}`, { method: 'DELETE' }).catch(() => undefined) } -/** Lien public vers un profil. */ -export const profileLink = (name: string) => `${location.origin}${location.pathname}#/u/${name}` +/** Lien vers un profil : bobinoo.org/@pseudo (ouvert sans compte seulement si la personne l'a rendu public). */ +export const profileLink = (name: string) => `${location.origin}/@${name}` + +/** Pseudo d'un lien de profil ouvert (« /@pseudo »), sinon undefined. */ +export function profileFromPath(path = location.pathname): string | undefined { + return path.match(/^\/@([a-z0-9_]{3,20})\/?$/i)?.[1].toLowerCase() +} diff --git a/supabase/migrations/20261202120000_public_profile_link.sql b/supabase/migrations/20261202120000_public_profile_link.sql new file mode 100644 index 0000000..b0cd690 --- /dev/null +++ b/supabase/migrations/20261202120000_public_profile_link.sql @@ -0,0 +1,165 @@ +-- Profil public : le lien bobinoo.org/@pseudo s'ouvre sans compte, seulement si la personne l'a activé. +-- +-- Par défaut, rien ne change : un profil n'est visible que des membres connectés (et de ses abonnés s'il est privé). +-- Avec « Profil visible sans compte » activé (et un profil non privé, non suspendu), public_profile() renvoie +-- la carte du profil, ses Top 5, ce qu'il regarde et ses derniers titres vus, réduits au strict nécessaire +-- (titre, affiche, type, année, note) : ni avis, ni dates, ni notes perso. La bibliothèque complète reste +-- réservée aux membres (get_profile_items passe toujours par can_view). +-- +-- Pas de contrôle de double authentification dans public_profile : elle ne renvoie que ce que la personne a choisi +-- de montrer à tout le monde, et rien de plus à un compte connecté. Un profil non public, privé, suspendu ou +-- inexistant donne la même réponse (null) : impossible de savoir si un pseudo existe. Idempotent. + +alter table public.profiles add column if not exists public_link boolean not null default false; +comment on column public.profiles.public_link is 'Lien bobinoo.org/@pseudo ouvert sans compte (choix de la personne, désactivé par défaut)'; +grant select (public_link) on public.profiles to authenticated; +grant update (public_link) on public.profiles to authenticated; + +-- Fiche réduite pour les visiteurs sans compte +create or replace function public.azuu_public_item_min(d jsonb) +returns jsonb language sql immutable set search_path = '' as $$ + select jsonb_strip_nulls(jsonb_build_object( + 'id', d->'id', + 'title', d->'title', + 'type', d->'type', + 'subtype', d->'subtype', + 'year', d->'year', + 'status', d->'status', + 'rating', d->'rating', + 'poster', case when length(coalesce(d->>'poster', '')) <= 150000 then d->'poster' end, + 'externalId', d->'externalId', + 'genres', d->'genres', + 'top', d->'top' + )) +$$; +revoke all on function public.azuu_public_item_min(jsonb) from public, anon, authenticated; + +create or replace function public.public_profile(p_username text) +returns jsonb language plpgsql stable security definer set search_path = '' as $$ +declare + name text := lower(trim(coalesce(p_username, ''))); + p public.profiles; +begin + if name !~ '^[a-z0-9_]{3,20}$' then + return null; + end if; + select * into p from public.profiles + where username = name and public_link and not is_private and not suspended; + if not found then + return null; + end if; + return jsonb_build_object( + 'id', p.id, + 'username', p.username, + 'display_name', p.display_name, + 'avatar_url', p.avatar_url, + 'banner_url', p.banner_url, + 'bio', p.bio, + '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'), + '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.azuu_public_item_min(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.azuu_public_item_min(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.azuu_public_item_min(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; +$$; +revoke all on function public.public_profile(text) from public; +grant execute on function public.public_profile(text) to anon, authenticated; + +-- get_profile : renvoie aussi le réglage du lien public, seulement à la personne elle-même (redéfinie à l'identique sinon) +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 or not public.azuu_mfa_ok() 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 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 p.id = me then + res := res || jsonb_build_object('public_link', p.public_link); + end if; + 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; +$$; diff --git a/vite.config.ts b/vite.config.ts index 9e2ff67..0c19a09 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -137,7 +137,8 @@ export default defineConfig(({ mode }) => { '**/icons/icon-maskable-512.png', ], // L'app vit entièrement sur « / » (routes après le #) : toute autre adresse reçoit la page 404 du serveur - navigateFallbackAllowlist: [/^\/(?:index\.html)?(?:\?.*)?$/], + // L'accueil, et les liens de profil (bobinoo.org/@pseudo) : même hors-ligne, c'est l'app qui s'ouvre + navigateFallbackAllowlist: [/^\/(?:index\.html)?(?:\?.*)?$/, /^\/@[A-Za-z0-9_]{3,20}\/?(?:\?.*)?$/], // Les pages légales sont de vraies pages, pas l'app navigateFallbackDenylist: [/^\/privacy/, /^\/legal/, /^\/terms/, /^\/credits/, /^\/supprimer-compte/], runtimeCaching: [