Author SHA1 Message Date
Claude dba91678bd Suppression du système de notifications
- Plus de cloche sur l'accueil ni de panneau de notifications.
- Plus de notifications push : réglage retiré, service worker sans push-sw.js,
  fonction send-push et script VAPID supprimés du dépôt.
- Réglages « Notifications » retirés (et notifPrefs des réglages synchronisés).
- Plus d'envoi des nouveaux épisodes au serveur pour les notifications.
- Au lancement, l'appli résilie l'ancien abonnement push de l'appareil s'il en reste un.
- Textes retirés des 18 langues ; politique de confidentialité mise à jour.
- Serveur : migration 20261122120000_remove_notifications.sql (déjà appliquée en ligne) :
  plus aucune notification créée ni envoyée, données vidées.
- Les demandes d'abonnement et invitations aux listes restent accessibles
  depuis le profil et les listes partagées.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
2026-11-22 17:04:40 +00:00
romain 3eb8d4651c Merge pull request 'Revisionnage : revoir un film ou une série déjà terminés' (#3) from claude/rewatch into main
deploy / deploy (push) Successful in 1m7s
Reviewed-on: romain/kino#3
2026-10-18 18:05:28 +00:00
43 changed files with 62 additions and 2298 deletions

No files matched your search

+3 -4
View File
@@ -39,10 +39,10 @@ npm run build # build de prod
## Architecture client (repères)
- `src/store.tsx` — fournisseur de données (IndexedDB = source locale, état React = copie de travail), synchro, thème.
- `src/lib/cloud/` — `auth.ts` (GoTrue maison, PKCE Google), `sync.ts` (push/pull LWW), `social.ts`, `admin.ts`, `reviews.ts`, `notifications.ts`, `api.ts` (`cloudFetch`).
- `src/lib/cloud/` — `auth.ts` (GoTrue maison, PKCE Google), `sync.ts` (push/pull LWW), `social.ts`, `admin.ts`, `reviews.ts`, `api.ts` (`cloudFetch`).
- `src/lib/airing.ts` — suivi des sorties d'épisodes (TMDB/AniList), cache local.
- `src/lib/franchise.ts` — saisons & dédoublonnage de franchises (TMDB 1 fiche multi-saisons vs AniList 1 entrée/saison).
- `src/components/social/` — profils, recherche, fil d'amis, avis par titre (`TitleReviews`), réactions (`Reactions`), notifications (`Notifications`), aperçu d'une fiche (`ItemPeek`), `SocialProvider` (pile d'overlays).
- `src/components/social/` — profils, recherche, fil d'amis, avis par titre (`TitleReviews`), réactions (`Reactions`), aperçu d'une fiche (`ItemPeek`), `SocialProvider` (pile d'overlays).
- `src/pages/` — `HomePage`, `CatalogPage`, `StatsPage`, `SettingsPage`, `AdminPage`.
- `src/App.tsx` — shell + routes par hash (`#/home`, `#/admin`…), `BottomNav` (mobile) + `SideNav` (desktop ≥ lg).
@@ -63,7 +63,6 @@ npm run build # build de prod
## État / en attente (au 9 oct. 2026)
- Appliqués en ligne : tout jusqu'à `20261008150000`, + `20261009110000_private_tags` et `20261009140000_challenges`.
- **À coller dans SQL Editor** : `supabase/A_COLLER_2026-10-09.sql` (commentaires/spoilers, listes partagées, web push, modération, bugs/erreurs). Idempotent.
- Edge functions déployées : `tmdb` v4 (watch/providers, /find), `send-push` v1.
- Push : générer les clés (`node scripts/gen-vapid.mjs`), 4 secrets Edge Functions + `azuu_push_secret` dans Vault → voir `supabase/PUSH_SETUP.md`.
- **Notifications retirées (22 nov. 2026)** : plus de cloche ni de push. Migration `20261122120000_remove_notifications.sql` appliquée en ligne (triggers supprimés, `azuu_notify` ne fait plus rien, tables `notifications` / `push_subscriptions` vidées mais gardées). Ne pas les réintroduire sans demande.
- Sauvegardes : secrets Gitea `SUPABASE_DB_URL` + `BACKUP_PASSPHRASE`, préparation du VPS → voir `deploy/BACKUP.md`.
- Recommandé : activer **Leaked Password Protection** (Authentication → Passwords) ; supprimer `_tmp_ping2` / `_tmp_sd2`.
+3 -4
View File
@@ -40,7 +40,6 @@
<tr><td>Bibliothèque : titres, statuts, épisodes vus, dates, notes, avis, listes, réglages</td><td>Faire fonctionner ton journal et le synchroniser</td><td>Contrat</td></tr>
<tr><td>Profil : pseudo, nom affiché, bio, photo, bannière, top 5</td><td>Te présenter aux autres membres</td><td>Contrat</td></tr>
<tr><td>Abonnements, demandes de suivi, réactions emoji aux avis</td><td>Fonctions sociales</td><td>Contrat</td></tr>
<tr><td>Notifications (nouveaux abonnés, réactions, nouveaux épisodes des séries suivies) et leurs préférences</td><td>Te prévenir de ce qui te concerne ; chaque type se désactive dans les réglages</td><td>Contrat</td></tr>
</table>
<p>Rien d'autre n'est collecté : pas de date de naissance, pas de numéro de téléphone, pas de localisation, pas de contacts.</p>
@@ -48,7 +47,7 @@
<ul>
<li>Ton adresse e-mail n'est jamais visible par les autres utilisateurs.</li>
<li>Ton profil (pseudo, nom, photo, bannière, bio, titres vus, notes, avis) est visible par les utilisateurs connectés. Si tu passes ton compte en <strong>privé</strong> (Modifier le profil → Compte privé), seules les personnes que tu acceptes peuvent le voir.</li>
<li>Tes listes personnelles, tes réglages et tes notifications restent privés.</li>
<li>Tes listes personnelles et tes réglages restent privés.</li>
<li>L'éditeur, en tant qu'administrateur, peut retirer un contenu ou suspendre un compte qui ne respecte pas les <a href="/legal.html#conditions">conditions d'utilisation</a>.</li>
</ul>
@@ -67,7 +66,7 @@
<p>Kino garde une copie de ta bibliothèque sur ton appareil (IndexedDB) et quelques préférences (thème, langue, session de connexion) dans le stockage local du navigateur, pour fonctionner hors-ligne. <strong>Aucun cookie</strong>, aucun traceur, aucun outil de mesure d'audience : ces stockages sont strictement nécessaires au service et ne demandent donc pas de bandeau de consentement. Se déconnecter efface la session.</p>
<h2>Durée de conservation</h2>
<p>Tes données sont gardées tant que ton compte existe. Quand tu supprimes ton compte, tout est effacé définitivement et immédiatement : bibliothèque, profil, photos, avis, réactions, abonnements et notifications. Seules tes 300 notifications les plus récentes sont gardées, les plus anciennes sont effacées automatiquement.</p>
<p>Tes données sont gardées tant que ton compte existe. Quand tu supprimes ton compte, tout est effacé définitivement et immédiatement : bibliothèque, profil, photos, avis, réactions et abonnements.</p>
<h2>Ce qui n'est jamais fait</h2>
<ul>
@@ -94,7 +93,7 @@
<hr />
<h1 style="font-size:1.4rem">Privacy policy (English summary)</h1>
<p>Kino is a free, ad-free personal watch journal published by Romain Dacet (data controller, contact: <a href="https://rdacet.fr">rdacet.fr</a>). 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, emoji reactions and notifications, 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 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 15 or older (or have a parent's consent). You can access, correct, export or delete your data from Settings, contact the publisher for any other request, and complain to the CNIL.</p>
<p>Kino is a free, ad-free personal watch journal published by Romain Dacet (data controller, contact: <a href="https://rdacet.fr">rdacet.fr</a>). 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 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 15 or older (or have a parent's consent). You can access, correct, export or delete your data from Settings, contact the publisher for any other request, and complain to the CNIL.</p>
<p class="muted"><a href="/">← Retour à Kino</a></p>
</main>
-72
View File
@@ -1,72 +0,0 @@
/* Kino — notifications push (chargé dans le service worker généré par Workbox via importScripts).
* Affiche la notification reçue, et au clic ouvre (ou ramène au premier plan) l'app sur le bon écran. */
/* eslint-env serviceworker */
// Écrans que le serveur peut demander d'ouvrir (tout le reste ouvre l'accueil)
var OPEN_RE = /^(notifications|item:[A-Za-z0-9_-]{1,64}|u:[a-z0-9_]{3,20})$/
function clip(v, max) {
if (typeof v !== 'string') return ''
v = v.replace(/[\u0000-\u001f\u007f]/g, ' ').trim()
return v.length > max ? v.slice(0, max - 1) + '…' : v
}
/** Adresse à ouvrir : uniquement « /?open=<écran> » sur ce site. */
function safeUrl(raw) {
try {
var u = new URL(typeof raw === 'string' ? raw : '/', self.location.origin)
var open = u.searchParams.get('open') || ''
if (u.origin === self.location.origin && u.pathname === '/' && OPEN_RE.test(open)) return '/?open=' + encodeURIComponent(open)
} catch (e) {
/* adresse invalide */
}
return '/'
}
self.addEventListener('push', function (event) {
var data = {}
try {
data = event.data ? event.data.json() : {}
} catch (e) {
data = {}
}
var title = clip(data.title, 120) || 'Kino'
var options = {
body: clip(data.body, 300),
tag: clip(data.tag, 64) || undefined,
icon: '/icons/icon-192.png',
data: { url: safeUrl(data.url) },
}
event.waitUntil(
Promise.all([
self.registration.showNotification(title, options),
// App ouverte : on lui signale qu'il y a du nouveau (compteur de la cloche)
self.clients.matchAll({ type: 'window', includeUncontrolled: true }).then(function (list) {
list.forEach(function (c) {
c.postMessage({ type: 'azuu:push' })
})
}),
]),
)
})
self.addEventListener('notificationclick', function (event) {
event.notification.close()
var url = safeUrl(event.notification.data && event.notification.data.url)
var open = new URL(url, self.location.origin).searchParams.get('open') || ''
event.waitUntil(
self.clients.matchAll({ type: 'window', includeUncontrolled: true }).then(function (list) {
// Une fenêtre de l'app est déjà ouverte : on la ramène et on lui dit quoi afficher
for (var i = 0; i < list.length; i++) {
var c = list[i]
var cu = new URL(c.url)
// (les pages légales, /privacy et /legal, ne sont pas l'app)
if (cu.origin === self.location.origin && cu.pathname === '/' && 'focus' in c) {
c.postMessage({ type: 'azuu:open', open: open })
return c.focus()
}
}
return self.clients.openWindow ? self.clients.openWindow(url) : undefined
}),
)
})
-30
View File
@@ -1,30 +0,0 @@
#!/usr/bin/env node
// Génère une paire de clés VAPID (P-256) pour les notifications push, et un secret de webhook.
// À lancer UNE fois sur ton PC : node scripts/gen-vapid.mjs
// Les valeurs affichées vont dans les secrets Supabase (jamais dans le dépôt, jamais dans .env / VITE_).
// Ne pas exécuter en CI. Voir supabase/PUSH_SETUP.md.
import { webcrypto as crypto } from 'node:crypto'
const b64url = (buf) => Buffer.from(buf).toString('base64url')
const pair = await crypto.subtle.generateKey({ name: 'ECDSA', namedCurve: 'P-256' }, true, ['sign', 'verify'])
const publicKey = b64url(await crypto.subtle.exportKey('raw', pair.publicKey))
const { d: privateKey } = await crypto.subtle.exportKey('jwk', pair.privateKey)
const webhookSecret = b64url(crypto.getRandomValues(new Uint8Array(32)))
console.log(`
=== 1) Supabase → Edge Functions → Secrets : 4 secrets (Nom = à gauche, Valeur = à droite) ===
(un secret qui existe déjà : le remplacer par cette nouvelle valeur)
VAPID_PUBLIC_KEY ${publicKey}
VAPID_PRIVATE_KEY ${privateKey}
VAPID_SUBJECT mailto:ton-adresse@example.com (mets ton adresse)
PUSH_WEBHOOK_SECRET ${webhookSecret}
=== 2) Supabase → SQL Editor : coller CETTE ligne telle quelle, puis Run ===
do $$ begin if exists (select 1 from vault.secrets where name = 'azuu_push_secret') then perform vault.update_secret((select id from vault.secrets where name = 'azuu_push_secret'), '${webhookSecret}'); else perform vault.create_secret('${webhookSecret}', 'azuu_push_secret'); end if; end $$;
Ces valeurs sont secrètes (sauf VAPID_PUBLIC_KEY) : ne les colle nulle part ailleurs.
Chaque lancement du script crée de NOUVELLES valeurs : les étapes 1 et 2 doivent venir du même lancement.
`)
+5 -2
View File
@@ -15,12 +15,12 @@ import StatsPage from './pages/StatsPage'
import SettingsPage from './pages/SettingsPage'
import AdminPage from './pages/AdminPage'
import NotFoundPage from './pages/NotFoundPage'
import PushBridge from './components/PushBridge'
import SyncIndicator from './components/SyncIndicator'
import { useMedia } from './store'
import type { SearchResult } from './lib/catalogApi'
import type { MediaItem } from './types'
import type { Completion } from './lib/seasons'
import { dropPushSubscription } from './lib/push'
const TABS: Tab[] = ['home', 'catalog', 'stats', 'settings']
// L'administration a sa propre route (#/admin), hors de la navigation principale
@@ -57,6 +57,10 @@ export default function App() {
const [roulette, setRoulette] = useState(false)
const [calendar, setCalendar] = useState(false)
// Notifications retirées : on résilie l'ancien abonnement push de cet appareil, s'il en reste un
useEffect(() => {
void dropPushSubscription()
}, [])
useEffect(() => {
const onHash = () => setRoute(routeFromHash())
window.addEventListener('hashchange', onHash)
@@ -100,7 +104,6 @@ export default function App() {
<BottomNav current={navTab} onChange={go} onAdd={openNew} />
<SyncIndicator />
<PushBridge />
{roulette && <Roulette onClose={() => setRoulette(false)} onOpen={openItem} />}
{calendar && <CalendarView onClose={() => setCalendar(false)} onOpen={openItem} />}
-75
View File
@@ -1,75 +0,0 @@
import { useEffect, useRef, useState } from 'react'
import { keepPushFresh } from '../lib/push'
import { useMedia } from '../store'
import { useSocial } from './social/SocialProvider'
/** Écrans qu'une notification push peut ouvrir (« /?open=… », voir public/push-sw.js). */
const OPEN_RE = /^(notifications|item:[A-Za-z0-9_-]{1,64}|u:[a-z0-9_]{3,20})$/
/** Lit (et retire de l'adresse) l'écran demandé par une notification au lancement de l'app. */
function takeOpenParam(): string | null {
try {
const params = new URLSearchParams(location.search)
const open = params.get('open')
if (open === null) return null
params.delete('open')
const q = params.toString()
history.replaceState(history.state, '', `${location.pathname}${q ? `?${q}` : ''}${location.hash}`)
return OPEN_RE.test(open) ? open : null
} catch {
return null
}
}
/**
* Lien entre les notifications push et l'app : ouvre le bon écran au clic sur une notification
* (app lancée, ou déjà ouverte : message du service worker), met à jour la cloche quand
* une notification arrive, et garde l'abonnement de l'appareil à jour côté serveur.
*/
export default function PushBridge() {
const { account, items, loading } = useMedia()
const social = useSocial()
const [target, setTarget] = useState<string | null>(takeOpenParam)
const socialRef = useRef(social)
socialRef.current = social
// Messages du service worker
useEffect(() => {
if (!('serviceWorker' in navigator)) return
const onMessage = (e: MessageEvent) => {
const data = e.data as { type?: unknown; open?: unknown } | null
if (!data || typeof data !== 'object') return
if (data.type === 'azuu:open' && typeof data.open === 'string' && OPEN_RE.test(data.open)) setTarget(data.open)
else if (data.type === 'azuu:push') void socialRef.current.refresh()
}
navigator.serviceWorker.addEventListener('message', onMessage)
return () => navigator.serviceWorker.removeEventListener('message', onMessage)
}, [])
// Ouvre l'écran demandé une fois le compte et la bibliothèque chargés
useEffect(() => {
if (!target) return
if (!account) {
// Pas (ou plus) connecté : rien à ouvrir
if (!loading) setTarget(null)
return
}
if (!social.enabled || loading) return
setTarget(null)
if (target === 'notifications') social.openNotifications()
else if (target.startsWith('u:')) social.openProfile(target.slice(2))
else {
const item = items.find((i) => i.id === target.slice(5))
if (item) social.openItem(item)
else social.openNotifications()
}
}, [target, account, social, loading, items])
// Abonnement push renouvelé par le navigateur, langue changée… : on le signale au serveur
const accountOn = !!account
useEffect(() => {
if (accountOn) void keepPushFresh()
}, [accountOn])
return null
}
-85
View File
@@ -1,85 +0,0 @@
import { BellRing, Loader2 } from 'lucide-react'
import { useEffect, useState } from 'react'
import { t } from '../i18n'
import { enablePush, disablePush, getPushState, PushError, type PushState } from '../lib/push'
import { cx } from '../lib/utils'
/** Réglages → Notifications : « Notifications sur cet appareil » (Web Push, même app fermée). */
export default function PushToggle() {
const [state, setState] = useState<PushState | null>(null)
const [busy, setBusy] = useState(false)
const [error, setError] = useState<string | null>(null)
useEffect(() => {
let alive = true
void getPushState().then((s) => alive && setState(s))
return () => {
alive = false
}
}, [])
if (state === null) return null
const on = state === 'on'
const available = state === 'on' || state === 'off'
const toggle = async () => {
if (busy || !available) return
setBusy(true)
setError(null)
try {
if (on) {
await disablePush()
setState('off')
} else {
// La permission n'est demandée qu'ici, au clic
setState(await enablePush())
}
} catch (e) {
const code = e instanceof PushError ? e.code : 'failed'
if (code === 'denied') setState('denied')
else setError(code === 'not-ready' ? t('push.notReady') : t('push.error'))
} finally {
setBusy(false)
}
}
const hint =
state === 'needs-install'
? t('push.iosInstall')
: state === 'unsupported'
? t('push.unsupported')
: state === 'denied'
? t('push.denied')
: t('push.deviceHint')
return (
<div className="card mb-3 overflow-hidden">
<button
type="button"
role="switch"
aria-checked={on}
aria-disabled={!available || busy}
onClick={() => void toggle()}
className={cx('flex w-full items-center gap-3.5 px-4 py-3.5 text-start', !available && 'cursor-default')}
>
<span className={cx('grid size-10 shrink-0 place-items-center rounded-full bg-surface-2', on ? 'text-accent' : 'text-ink-2')}>
{busy ? <Loader2 size={18} className="animate-spin" /> : <BellRing size={18} />}
</span>
<span className="min-w-0 flex-1">
<span className="block text-sm font-medium">{t('push.device')}</span>
<span className={cx('mt-0.5 block text-xs', state === 'denied' ? 'text-accent' : 'text-ink-3')}>{hint}</span>
</span>
{available && (
<span className={cx('relative h-6 w-11 shrink-0 rounded-full transition-colors', on ? 'bg-accent-fill' : 'border border-line-strong bg-surface-2')}>
<span className={cx('absolute top-0.5 size-5 rounded-full bg-ink transition-all', on ? 'start-[22px] bg-on-accent' : 'start-0.5')} />
</span>
)}
</button>
{error && (
<p role="alert" className="border-t border-line px-4 py-2.5 text-xs text-accent">
{error}
</p>
)}
</div>
)
}
-289
View File
@@ -1,289 +0,0 @@
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
const FOLLOW_KINDS: NotificationKind[] = ['follow_request', 'follow_accepted', 'new_follower']
const EPISODE_KINDS: NotificationKind[] = ['new_episode', 'new_season']
const VERB: Record<NotificationKind, () => string> = {
follow_request: () => t('notif.follow_request'),
follow_accepted: () => t('notif.follow_accepted'),
new_follower: () => t('notif.new_follower'),
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,
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)
useEffect(() => {
let alive = true
void (async () => {
try {
const page = await listNotifications(0)
if (!alive) return
setItems(page)
setDone(page.length < PAGE)
} catch {
if (alive) {
setItems([])
setDone(true)
}
}
markNotificationsRead().catch(() => {})
})()
return () => {
alive = false
}
}, [])
const loadMore = async () => {
if (!items || loadingMore) return
setLoadingMore(true)
try {
const page = await listNotifications(items.length)
setItems((prev) => [...(prev ?? []), ...page])
setDone(page.length < PAGE)
} catch {
setDone(true)
} finally {
setLoadingMore(false)
}
}
return (
<Sheet title={t('notif.title')} label={t('notif.title')} onClose={onClose} elevated>
{items === undefined ? (
<p className="flex items-center justify-center py-16 text-ink-3">
<Loader2 size={20} className="animate-spin" />
</p>
) : items.length === 0 ? (
<div className="px-4">
<EmptyState title={t('notif.empty')} />
</div>
) : (
<ul>
{items.map((n) => (
<Row key={n.id} n={n} onOpenProfile={onOpenProfile} onOpenItem={onOpenItem} onOpenComments={onOpenComments} onOpenSharedList={onOpenSharedList} />
))}
{!done && (
<li className="p-4">
<button onClick={loadMore} disabled={loadingMore} className="btn btn-ghost w-full">
{loadingMore ? <Loader2 size={15} className="animate-spin" /> : t('social.loadMore')}
</button>
</li>
)}
</ul>
)}
</Sheet>
)
}
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')
// ── Nouvel épisode / nouvelle saison ──
if (isEpisode) {
const title = n.title ?? '—'
const inner = (
<>
{unread && <span className="size-2 shrink-0 rounded-full bg-accent-fill" aria-hidden="true" />}
<span className="grid size-[38px] shrink-0 place-items-center rounded-full bg-surface-2 text-accent">
<Tv size={18} />
</span>
<span className="min-w-0 flex-1 text-sm leading-snug text-ink-2">
<b className="text-ink">{t(n.kind === 'new_season' ? 'notif.new_season' : 'notif.new_episode', { title })}</b>
{n.episode != null && <span className="text-ink-3"> · {t('episodes.short', { n: n.episode })}</span>}
</span>
<span className="shrink-0 text-xs text-ink-3">{formatDate(n.created_at)}</span>
</>
)
return (
<li>
{n.item_id ? (
<button onClick={() => onOpenItem(n.item_id!)} className={cx(base, 'w-full')}>
{inner}
</button>
) : (
<div className={base}>{inner}</div>
)}
</li>
)
}
// ── 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')
const username = actor?.username
const target = username != null && FOLLOW_KINDS.includes(n.kind) ? username : null
const inner = (
<>
{unread && <span className="size-2 shrink-0 rounded-full bg-accent-fill" aria-hidden="true" />}
<Avatar url={actor?.avatar_url ?? undefined} name={actorName} size={38} />
<span className="min-w-0 flex-1 text-sm leading-snug text-ink-2">
<b className="text-ink">{actorName}</b> {VERB[n.kind]()}
{n.kind === 'reaction' && (
<>
{n.emoji ? ` ${n.emoji}` : ''}
{n.title ? ` ${t('notif.on', { title: n.title })}` : ''}
</>
)}
</span>
<span className="shrink-0 text-xs text-ink-3">{formatDate(n.created_at)}</span>
</>
)
return (
<li>
{target != null ? (
<button onClick={() => onOpenProfile(target)} className={cx(base, 'w-full')}>
{inner}
</button>
) : (
<div className={base}>{inner}</div>
)}
</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>
)
}
+3 -42
View File
@@ -1,6 +1,5 @@
import { createContext, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from 'react'
import { getFollowRequests, getMyProfile, type Profile, type ProfileCard } from '../../lib/cloud/social'
import { unreadCount } from '../../lib/cloud/notifications'
import { useMedia } from '../../store'
import type { MediaItem } from '../../types'
import EditProfile from './EditProfile'
@@ -9,7 +8,6 @@ import ItemPeek, { type PeekOwner } from './ItemPeek'
import PeopleSearch from './PeopleSearch'
import ProfileView from './ProfileView'
import TitleReviews from './TitleReviews'
import Notifications from './Notifications'
import { useOnResume } from '../../lib/onResume'
import WelcomeProfile, { RANDOM_USERNAME } from './WelcomeProfile'
import CommentsSheet from './CommentsSheet'
@@ -30,10 +28,6 @@ interface SocialApi {
openFollowList: (profile: Profile, kind: 'followers' | 'following') => void
/** Tous les avis sur un titre (amis / autres) */
openReviews: (externalId: string, title: string) => void
/** Panneau des notifications */
openNotifications: () => void
/** Notifications non lues */
unread: number
peek: (item: MediaItem, owner?: PeekOwner) => void
/** Ouvre la fiche si elle est à moi, sinon l'aperçu */
openItem: (item: MediaItem, owner?: PeekOwner) => void
@@ -60,8 +54,6 @@ const SocialContext = createContext<SocialApi>({
openEdit: () => {},
openFollowList: () => {},
openReviews: () => {},
openNotifications: () => {},
unread: 0,
peek: () => {},
openItem: () => {},
openComments: () => {},
@@ -80,7 +72,6 @@ type Overlay =
| { kind: 'edit' }
| { 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 }
@@ -100,7 +91,6 @@ export function SocialProvider({
const enabled = !!account
const [me, setMe] = useState<Profile | null>(null)
const [requests, setRequests] = useState<ProfileCard[]>([])
const [unread, setUnread] = useState(0)
const [stack, setStack] = useState<Overlay[]>([])
const [peeked, setPeeked] = useState<{ item: MediaItem; owner?: PeekOwner }>()
const [sharedTick, setSharedTick] = useState(0)
@@ -125,10 +115,9 @@ export function SocialProvider({
const refresh = useCallback(async () => {
if (!enabled || !navigator.onLine) return
try {
const [p, r, u] = await Promise.all([getMyProfile(), getFollowRequests(), unreadCount()])
const [p, r] = await Promise.all([getMyProfile(), getFollowRequests()])
setMe(p)
setRequests(r)
setUnread(u)
} catch {
/* hors-ligne / serveur pas encore à jour : le reste de l'app fonctionne */
}
@@ -202,12 +191,6 @@ export function SocialProvider({
openEdit: () => push({ kind: 'edit' }),
openFollowList: (profile, list) => push({ kind: 'follows', profile, list }),
openReviews: (externalId, title) => push({ kind: 'reviews', externalId, title }),
openNotifications: () => {
// La liste se marque lue elle-même, après chargement (sinon les « non lu » n'étaient jamais visibles)
setUnread(0)
push({ kind: 'notifications' })
},
unread,
peek: (item, owner) => setPeeked({ item, owner }),
openItem,
openComments: (authorId, itemId, title) => push({ kind: 'comments', authorId, itemId, title }),
@@ -217,7 +200,7 @@ export function SocialProvider({
sharedTick,
bumpShared,
}),
[enabled, me, requests, unread, refresh, push, openItem, openTitle, sharedTick, bumpShared],
[enabled, me, requests, refresh, push, openItem, openTitle, sharedTick, bumpShared],
)
return (
@@ -239,30 +222,8 @@ export function SocialProvider({
<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}
onClose={pop}
onOpenProfile={(u) => push({ kind: 'profile', username: u })}
onOpenItem={(id) => {
const it = items.find((i) => i.id === id)
if (it) {
pop()
onOpenOwnItem(it)
}
}}
onOpenComments={(itemId, title) => {
if (!me) return
pop()
push({ kind: 'comments', authorId: me.id, itemId, title })
}}
onOpenSharedList={(id) => {
pop()
push({ kind: 'sharedList', id })
}}
/>
<InvitePeople key={k} listId={o.listId} listName={o.listName} onClose={pop} />
),
)}
{children}
-28
View File
@@ -245,14 +245,6 @@ const dict: Translations = {
'settings.installApp': 'تثبيت التطبيق',
'settings.installHint': 'أضِف Kino إلى شاشتك الرئيسية أو سطح المكتب.',
'settings.installed': 'تم تثبيت التطبيق',
'settings.notifs': 'الإشعارات',
'settings.notifsHint': 'اختر ما يُفعّل الجرس.',
'settings.notifEpisodes': 'حلقات جديدة',
'settings.notifFollows': 'متابعون جدد',
'settings.notifAccepted': 'طلبات مقبولة',
'settings.notifReactions': 'تفاعلات على تقييماتي',
'notif.new_episode': 'حلقة جديدة من {title}',
'notif.new_season': 'موسم جديد من {title}',
'reviews.title': 'التقييمات',
'reviews.friends': 'أصدقاؤك',
'reviews.others': 'أعضاء آخرون',
@@ -261,16 +253,7 @@ const dict: Translations = {
'reviews.none': 'لا توجد تقييمات بعد',
'reviews.seeAll': 'عرض كل التقييمات',
'reviews.react': 'تفاعل',
'notif.title': 'الإشعارات',
'notif.empty': 'لا إشعارات',
'notif.someone': 'شخص ما',
'notif.follow_request': 'يريد متابعتك',
'notif.follow_accepted': 'قبل طلبك',
'notif.new_follower': 'بدأ بمتابعتك',
'notif.reaction': 'تفاعل مع تقييمك',
'notif.on': 'على {title}',
'home.notifications': 'الإشعارات',
'home.notificationsN': '{count} إشعارات',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1290,13 +1273,6 @@ const dict: Translations = {
'challenges.more_many': "+ {count} تحديًا آخر",
'challenges.more_other': "+ {count} تحدٍّ آخر",
// — Notifications push & indicateur hors-ligne —
'push.device': "الإشعارات على هذا الجهاز",
'push.deviceHint': "حتى عندما يكون التطبيق مغلقًا. تنطبق الخيارات أدناه أيضًا.",
'push.iosInstall': "على iPhone وiPad، أضف Kino أولًا إلى الشاشة الرئيسية (iOS 16.4 أو أحدث)، ثم افتح التطبيق من أيقونته لتفعيل الإشعارات.",
'push.unsupported': "هذا المتصفح لا يدعم الإشعارات الفورية.",
'push.denied': "الإشعارات محظورة لهذا الموقع. اسمح بها من إعدادات المتصفح ثم حاول مجددًا.",
'push.notReady': "الإشعارات الفورية غير متاحة على الخادم بعد.",
'push.error': "تعذّر تفعيل الإشعارات. تحقق من اتصالك وحاول مجددًا.",
'netPill.offlineSync': "غير متصل — ستتم مزامنة تعديلاتك",
'netPill.offlineLocal': "غير متصل — كل شيء محفوظ على هذا الجهاز",
'netPill.synced': "تمت المزامنة",
@@ -1436,10 +1412,6 @@ const dict: Translations = {
'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': "قائمة مشتركة جديدة",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'App installieren',
'settings.installHint': 'Füge Kino zum Startbildschirm oder Desktop hinzu.',
'settings.installed': 'App installiert',
'settings.notifs': 'Mitteilungen',
'settings.notifsHint': 'Lege fest, was die Glocke auslöst.',
'settings.notifEpisodes': 'Neue Folgen',
'settings.notifFollows': 'Neue Follower',
'settings.notifAccepted': 'Angenommene Anfragen',
'settings.notifReactions': 'Reaktionen auf meine Rezensionen',
'notif.new_episode': 'Neue Folge von {title}',
'notif.new_season': 'Neue Staffel von {title}',
'reviews.title': 'Rezensionen',
'reviews.friends': 'Deine Freunde',
'reviews.others': 'Andere Mitglieder',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'Noch keine Rezensionen',
'reviews.seeAll': 'Alle Rezensionen ansehen',
'reviews.react': 'Reagieren',
'notif.title': 'Mitteilungen',
'notif.empty': 'Keine Mitteilungen',
'notif.someone': 'Jemand',
'notif.follow_request': 'möchte dir folgen',
'notif.follow_accepted': 'hat deine Anfrage angenommen',
'notif.new_follower': 'folgt dir jetzt',
'notif.reaction': 'hat auf deine Rezension reagiert',
'notif.on': 'zu {title}',
'home.notifications': 'Mitteilungen',
'home.notificationsN': '{count} Mitteilungen',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ {count} weitere Challenge",
'challenges.more_other': "+ {count} weitere Challenges",
// — Notifications push & indicateur hors-ligne —
'push.device': "Benachrichtigungen auf diesem Gerät",
'push.deviceHint': "Auch wenn die App geschlossen ist. Die Auswahl unten gilt ebenfalls.",
'push.iosInstall': "Auf iPhone und iPad füge Kino zuerst zum Home-Bildschirm hinzu (iOS 16.4 oder neuer) und öffne die App dann über ihr Symbol, um Benachrichtigungen zu aktivieren.",
'push.unsupported': "Dieser Browser unterstützt keine Push-Benachrichtigungen.",
'push.denied': "Benachrichtigungen sind für diese Seite blockiert. Erlaube sie in den Browser-Einstellungen und versuche es erneut.",
'push.notReady': "Push-Benachrichtigungen sind auf dem Server noch nicht verfügbar.",
'push.error': "Benachrichtigungen konnten nicht aktiviert werden. Prüfe deine Verbindung und versuche es erneut.",
'netPill.offlineSync': "Offline — deine Änderungen werden synchronisiert",
'netPill.offlineLocal': "Offline — alles bleibt auf diesem Gerät gespeichert",
'netPill.synced': "Synchronisiert",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'Install the app',
'settings.installHint': 'Add Kino to your home screen or desktop.',
'settings.installed': 'App installed',
'settings.notifs': 'Notifications',
'settings.notifsHint': 'Choose what triggers the bell.',
'settings.notifEpisodes': 'New episodes',
'settings.notifFollows': 'New followers',
'settings.notifAccepted': 'Accepted requests',
'settings.notifReactions': 'Reactions to my reviews',
'notif.new_episode': 'New episode of {title}',
'notif.new_season': 'New season of {title}',
'reviews.title': 'Reviews',
'reviews.friends': 'Your friends',
'reviews.others': 'Other members',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'No reviews yet',
'reviews.seeAll': 'See all reviews',
'reviews.react': 'React',
'notif.title': 'Notifications',
'notif.empty': 'No notifications',
'notif.someone': 'Someone',
'notif.follow_request': 'wants to follow you',
'notif.follow_accepted': 'accepted your request',
'notif.new_follower': 'started following you',
'notif.reaction': 'reacted to your review',
'notif.on': 'on {title}',
'home.notifications': 'Notifications',
'home.notificationsN': '{count} notifications',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ {count} more challenge",
'challenges.more_other': "+ {count} more challenges",
// — Notifications push & indicateur hors-ligne —
'push.device': "Notifications on this device",
'push.deviceHint': "Even when the app is closed. The choices below apply too.",
'push.iosInstall': "On iPhone and iPad, first add Kino to your Home Screen (iOS 16.4 or later), then open the app from its icon to turn on notifications.",
'push.unsupported': "This browser doesn’t support push notifications.",
'push.denied': "Notifications are blocked for this site. Allow them in your browser settings, then try again.",
'push.notReady': "Push notifications aren’t available on the server yet.",
'push.error': "Couldn’t turn on notifications. Check your connection and try again.",
'netPill.offlineSync': "Offline — your changes will sync",
'netPill.offlineLocal': "Offline — everything stays saved on this device",
'netPill.synced': "Synced",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'Instalar la aplicación',
'settings.installHint': 'Añade Kino a tu pantalla de inicio o escritorio.',
'settings.installed': 'Aplicación instalada',
'settings.notifs': 'Notificaciones',
'settings.notifsHint': 'Elige qué activa la campana.',
'settings.notifEpisodes': 'Nuevos episodios',
'settings.notifFollows': 'Nuevos seguidores',
'settings.notifAccepted': 'Solicitudes aceptadas',
'settings.notifReactions': 'Reacciones a mis opiniones',
'notif.new_episode': 'Nuevo episodio de {title}',
'notif.new_season': 'Nueva temporada de {title}',
'reviews.title': 'Opiniones',
'reviews.friends': 'Tus amigos',
'reviews.others': 'Otros miembros',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'Aún no hay opiniones',
'reviews.seeAll': 'Ver todas las opiniones',
'reviews.react': 'Reaccionar',
'notif.title': 'Notificaciones',
'notif.empty': 'Sin notificaciones',
'notif.someone': 'Alguien',
'notif.follow_request': 'quiere seguirte',
'notif.follow_accepted': 'aceptó tu solicitud',
'notif.new_follower': 'empezó a seguirte',
'notif.reaction': 'reaccionó a tu opinión',
'notif.on': 'en {title}',
'home.notifications': 'Notificaciones',
'home.notificationsN': '{count} notificaciones',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ {count} reto más",
'challenges.more_other': "+ {count} retos más",
// — Notifications push & indicateur hors-ligne —
'push.device': "Notificaciones en este dispositivo",
'push.deviceHint': "Incluso con la app cerrada. Las opciones de abajo también se aplican.",
'push.iosInstall': "En iPhone y iPad, primero añade Kino a la pantalla de inicio (iOS 16.4 o posterior) y abre la app desde su icono para activar las notificaciones.",
'push.unsupported': "Este navegador no admite notificaciones push.",
'push.denied': "Las notificaciones están bloqueadas para este sitio. Permítelas en los ajustes del navegador y vuelve a intentarlo.",
'push.notReady': "Las notificaciones push aún no están disponibles en el servidor.",
'push.error': "No se pudieron activar las notificaciones. Comprueba tu conexión e inténtalo de nuevo.",
'netPill.offlineSync': "Sin conexión — tus cambios se sincronizarán",
'netPill.offlineLocal': "Sin conexión — todo queda guardado en este dispositivo",
'netPill.synced': "Sincronizado",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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",
-28
View File
@@ -241,14 +241,6 @@ const dict = {
'settings.installApp': 'Installer l\'application',
'settings.installHint': 'Ajoute Kino à ton écran d\'accueil ou ton bureau.',
'settings.installed': 'Application installée',
'settings.notifs': 'Notifications',
'settings.notifsHint': 'Choisis ce qui déclenche la cloche.',
'settings.notifEpisodes': 'Nouveaux épisodes',
'settings.notifFollows': 'Nouveaux abonnés',
'settings.notifAccepted': 'Demandes acceptées',
'settings.notifReactions': 'Réactions à mes avis',
'notif.new_episode': 'Nouvel épisode de {title}',
'notif.new_season': 'Nouvelle saison de {title}',
'reviews.title': 'Avis',
'reviews.friends': 'Tes amis',
'reviews.others': 'Autres membres',
@@ -257,16 +249,7 @@ const dict = {
'reviews.none': 'Aucun avis pour le moment',
'reviews.seeAll': 'Voir tous les avis',
'reviews.react': 'Réagir',
'notif.title': 'Notifications',
'notif.empty': 'Aucune notification',
'notif.someone': 'Quelqu’un',
'notif.follow_request': 'veut s’abonner à toi',
'notif.follow_accepted': 'a accepté ta demande',
'notif.new_follower': 's’est abonné à toi',
'notif.reaction': 'a réagi à ton avis',
'notif.on': 'sur {title}',
'home.notifications': 'Notifications',
'home.notificationsN': '{count} notifications',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Vue d\'ensemble',
@@ -1077,13 +1060,6 @@ const dict = {
'challenges.more_one': "+ {count} autre défi",
'challenges.more_other': "+ {count} autres défis",
// — Notifications push & indicateur hors-ligne —
'push.device': "Notifications sur cet appareil",
'push.deviceHint': "Même quand l’app est fermée. Les choix ci-dessous s’appliquent aussi.",
'push.iosInstall': "Sur iPhone et iPad, ajoute d’abord Kino à l’écran d’accueil (iOS 16.4 ou plus récent), puis ouvre l’app depuis son icône pour activer les notifications.",
'push.unsupported': "Ce navigateur ne gère pas les notifications push.",
'push.denied': "Notifications bloquées pour ce site. Autorise-les dans les réglages du navigateur, puis réessaie.",
'push.notReady': "Les notifications push ne sont pas encore disponibles sur le serveur.",
'push.error': "Impossible d’activer les notifications. Vérifie ta connexion et réessaie.",
'netPill.offlineSync': "Hors ligne — tes modifs seront synchronisées",
'netPill.offlineLocal': "Hors ligne — tout reste enregistré sur cet appareil",
'netPill.synced': "Synchronisé",
@@ -1223,10 +1199,6 @@ const dict = {
'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",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'ऐप इंस्टॉल करें',
'settings.installHint': 'Kino को अपनी होम स्क्रीन या डेस्कटॉप पर जोड़ें।',
'settings.installed': 'ऐप इंस्टॉल हो गया',
'settings.notifs': 'सूचनाएँ',
'settings.notifsHint': 'चुनो कि घंटी किससे बजे।',
'settings.notifEpisodes': 'नए एपिसोड',
'settings.notifFollows': 'नए फ़ॉलोअर',
'settings.notifAccepted': 'स्वीकृत अनुरोध',
'settings.notifReactions': 'मेरी समीक्षाओं पर प्रतिक्रियाएँ',
'notif.new_episode': '{title} का नया एपिसोड',
'notif.new_season': '{title} का नया सीज़न',
'reviews.title': 'समीक्षाएँ',
'reviews.friends': 'तुम्हारे दोस्त',
'reviews.others': 'अन्य सदस्य',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'अभी कोई समीक्षा नहीं',
'reviews.seeAll': 'सभी समीक्षाएँ देखें',
'reviews.react': 'प्रतिक्रिया दें',
'notif.title': 'सूचनाएँ',
'notif.empty': 'कोई सूचना नहीं',
'notif.someone': 'किसी ने',
'notif.follow_request': 'तुम्हें फ़ॉलो करना चाहता है',
'notif.follow_accepted': 'तुम्हारा अनुरोध स्वीकार किया',
'notif.new_follower': 'तुम्हें फ़ॉलो करने लगा',
'notif.reaction': 'तुम्हारी समीक्षा पर प्रतिक्रिया दी',
'notif.on': '{title} पर',
'home.notifications': 'सूचनाएँ',
'home.notificationsN': '{count} सूचनाएँ',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ {count} और चुनौती",
'challenges.more_other': "+ {count} और चुनौतियाँ",
// — Notifications push & indicateur hors-ligne —
'push.device': "इस डिवाइस पर सूचनाएँ",
'push.deviceHint': "ऐप बंद होने पर भी। नीचे दिए विकल्प भी लागू होते हैं।",
'push.iosInstall': "iPhone और iPad पर पहले Kino को होम स्क्रीन पर जोड़ें (iOS 16.4 या नया), फिर सूचनाएँ चालू करने के लिए ऐप को उसके आइकन से खोलें।",
'push.unsupported': "यह ब्राउज़र पुश सूचनाएँ सपोर्ट नहीं करता।",
'push.denied': "इस साइट के लिए सूचनाएँ ब्लॉक हैं। ब्राउज़र सेटिंग्स में अनुमति दें, फिर दोबारा कोशिश करें।",
'push.notReady': "पुश सूचनाएँ अभी सर्वर पर उपलब्ध नहीं हैं।",
'push.error': "सूचनाएँ चालू नहीं हो सकीं। अपना कनेक्शन जाँचें और दोबारा कोशिश करें।",
'netPill.offlineSync': "ऑफ़लाइन — आपके बदलाव सिंक हो जाएँगे",
'netPill.offlineLocal': "ऑफ़लाइन — सब कुछ इस डिवाइस पर सहेजा रहता है",
'netPill.synced': "सिंक हो गया",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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': "नई साझा सूची",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'Pasang aplikasi',
'settings.installHint': 'Tambahkan Kino ke layar utama atau desktop kamu.',
'settings.installed': 'Aplikasi terpasang',
'settings.notifs': 'Notifikasi',
'settings.notifsHint': 'Pilih apa yang memicu lonceng.',
'settings.notifEpisodes': 'Episode baru',
'settings.notifFollows': 'Pengikut baru',
'settings.notifAccepted': 'Permintaan diterima',
'settings.notifReactions': 'Reaksi pada ulasanku',
'notif.new_episode': 'Episode baru {title}',
'notif.new_season': 'Musim baru {title}',
'reviews.title': 'Ulasan',
'reviews.friends': 'Teman kamu',
'reviews.others': 'Anggota lain',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'Belum ada ulasan',
'reviews.seeAll': 'Lihat semua ulasan',
'reviews.react': 'Reaksi',
'notif.title': 'Notifikasi',
'notif.empty': 'Tidak ada notifikasi',
'notif.someone': 'Seseorang',
'notif.follow_request': 'ingin mengikutimu',
'notif.follow_accepted': 'menerima permintaanmu',
'notif.new_follower': 'mulai mengikutimu',
'notif.reaction': 'bereaksi pada ulasanmu',
'notif.on': 'di {title}',
'home.notifications': 'Notifikasi',
'home.notificationsN': '{count} notifikasi',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ {count} tantangan lain",
'challenges.more_other': "+ {count} tantangan lain",
// — Notifications push & indicateur hors-ligne —
'push.device': "Notifikasi di perangkat ini",
'push.deviceHint': "Bahkan saat aplikasi ditutup. Pilihan di bawah juga berlaku.",
'push.iosInstall': "Di iPhone dan iPad, tambahkan dulu Kino ke Layar Utama (iOS 16.4 atau lebih baru), lalu buka aplikasi dari ikonnya untuk mengaktifkan notifikasi.",
'push.unsupported': "Browser ini tidak mendukung notifikasi push.",
'push.denied': "Notifikasi diblokir untuk situs ini. Izinkan di pengaturan browser, lalu coba lagi.",
'push.notReady': "Notifikasi push belum tersedia di server.",
'push.error': "Tidak dapat mengaktifkan notifikasi. Periksa koneksimu dan coba lagi.",
'netPill.offlineSync': "Offline — perubahanmu akan disinkronkan",
'netPill.offlineLocal': "Offline — semuanya tetap tersimpan di perangkat ini",
'netPill.synced': "Tersinkron",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'Installa l\'app',
'settings.installHint': 'Aggiungi Kino alla schermata home o al desktop.',
'settings.installed': 'App installata',
'settings.notifs': 'Notifiche',
'settings.notifsHint': 'Scegli cosa attiva la campana.',
'settings.notifEpisodes': 'Nuovi episodi',
'settings.notifFollows': 'Nuovi follower',
'settings.notifAccepted': 'Richieste accettate',
'settings.notifReactions': 'Reazioni alle mie recensioni',
'notif.new_episode': 'Nuovo episodio di {title}',
'notif.new_season': 'Nuova stagione di {title}',
'reviews.title': 'Recensioni',
'reviews.friends': 'I tuoi amici',
'reviews.others': 'Altri membri',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'Ancora nessuna recensione',
'reviews.seeAll': 'Vedi tutte le recensioni',
'reviews.react': 'Reagisci',
'notif.title': 'Notifiche',
'notif.empty': 'Nessuna notifica',
'notif.someone': 'Qualcuno',
'notif.follow_request': 'vuole seguirti',
'notif.follow_accepted': 'ha accettato la tua richiesta',
'notif.new_follower': 'ha iniziato a seguirti',
'notif.reaction': 'ha reagito alla tua recensione',
'notif.on': 'su {title}',
'home.notifications': 'Notifiche',
'home.notificationsN': '{count} notifiche',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ {count} altra sfida",
'challenges.more_other': "+ {count} altre sfide",
// — Notifications push & indicateur hors-ligne —
'push.device': "Notifiche su questo dispositivo",
'push.deviceHint': "Anche con l’app chiusa. Valgono anche le scelte qui sotto.",
'push.iosInstall': "Su iPhone e iPad, aggiungi prima Kino alla schermata Home (iOS 16.4 o successivo), poi apri l’app dalla sua icona per attivare le notifiche.",
'push.unsupported': "Questo browser non supporta le notifiche push.",
'push.denied': "Le notifiche sono bloccate per questo sito. Consentile nelle impostazioni del browser, poi riprova.",
'push.notReady': "Le notifiche push non sono ancora disponibili sul server.",
'push.error': "Impossibile attivare le notifiche. Controlla la connessione e riprova.",
'netPill.offlineSync': "Offline — le modifiche verranno sincronizzate",
'netPill.offlineLocal': "Offline — tutto resta salvato su questo dispositivo",
'netPill.synced': "Sincronizzato",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'アプリをインストール',
'settings.installHint': 'Kino をホーム画面やデスクトップに追加します。',
'settings.installed': 'アプリをインストール済み',
'settings.notifs': '通知',
'settings.notifsHint': 'ベルを鳴らす項目を選びます。',
'settings.notifEpisodes': '新しいエピソード',
'settings.notifFollows': '新しいフォロワー',
'settings.notifAccepted': '承認されたリクエスト',
'settings.notifReactions': '自分のレビューへのリアクション',
'notif.new_episode': '「{title}」の新エピソード',
'notif.new_season': '「{title}」の新シーズン',
'reviews.title': 'レビュー',
'reviews.friends': '友だち',
'reviews.others': 'ほかのメンバー',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'まだレビューがありません',
'reviews.seeAll': 'すべてのレビューを見る',
'reviews.react': 'リアクション',
'notif.title': '通知',
'notif.empty': '通知はありません',
'notif.someone': '誰か',
'notif.follow_request': 'があなたをフォローしたがっています',
'notif.follow_accepted': 'があなたのリクエストを承認しました',
'notif.new_follower': 'があなたをフォローしました',
'notif.reaction': 'があなたのレビューにリアクションしました',
'notif.on': '「{title}」に',
'home.notifications': '通知',
'home.notificationsN': '{count}件の通知',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "ほか{count}件のチャレンジ",
'challenges.more_other': "ほか{count}件のチャレンジ",
// — Notifications push & indicateur hors-ligne —
'push.device': "このデバイスの通知",
'push.deviceHint': "アプリを閉じていても届きます。下の設定も適用されます。",
'push.iosInstall': "iPhone・iPad では、まず Kino をホーム画面に追加し(iOS 16.4 以降)、アイコンからアプリを開いて通知をオンにしてください。",
'push.unsupported': "このブラウザはプッシュ通知に対応していません。",
'push.denied': "このサイトの通知はブロックされています。ブラウザの設定で許可してから、もう一度お試しください。",
'push.notReady': "プッシュ通知はまだサーバーで利用できません。",
'push.error': "通知をオンにできませんでした。接続を確認して、もう一度お試しください。",
'netPill.offlineSync': "オフライン — 変更は後で同期されます",
'netPill.offlineLocal': "オフライン — すべてこのデバイスに保存されています",
'netPill.synced': "同期済み",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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': "新しい共有リスト",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': '앱 설치',
'settings.installHint': 'Kino을 홈 화면이나 바탕화면에 추가하세요.',
'settings.installed': '앱 설치됨',
'settings.notifs': '알림',
'settings.notifsHint': '벨을 울릴 항목을 선택하세요.',
'settings.notifEpisodes': '새 에피소드',
'settings.notifFollows': '새 팔로워',
'settings.notifAccepted': '수락된 요청',
'settings.notifReactions': '내 리뷰에 대한 반응',
'notif.new_episode': '{title} 새 에피소드',
'notif.new_season': '{title} 새 시즌',
'reviews.title': '리뷰',
'reviews.friends': '내 친구',
'reviews.others': '다른 회원',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': '아직 리뷰가 없어요',
'reviews.seeAll': '리뷰 모두 보기',
'reviews.react': '반응하기',
'notif.title': '알림',
'notif.empty': '알림이 없어요',
'notif.someone': '누군가',
'notif.follow_request': '님이 당신을 팔로우하고 싶어 해요',
'notif.follow_accepted': '님이 요청을 수락했어요',
'notif.new_follower': '님이 당신을 팔로우했어요',
'notif.reaction': '님이 당신의 리뷰에 반응했어요',
'notif.on': '{title}에',
'home.notifications': '알림',
'home.notificationsN': '알림 {count}개',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ 챌린지 {count}개 더",
'challenges.more_other': "+ 챌린지 {count}개 더",
// — Notifications push & indicateur hors-ligne —
'push.device': "이 기기의 알림",
'push.deviceHint': "앱이 닫혀 있어도 받아요. 아래 선택 사항도 적용돼요.",
'push.iosInstall': "iPhone과 iPad에서는 먼저 Kino을 홈 화면에 추가한 뒤(iOS 16.4 이상) 아이콘으로 앱을 열어 알림을 켜 주세요.",
'push.unsupported': "이 브라우저는 푸시 알림을 지원하지 않아요.",
'push.denied': "이 사이트의 알림이 차단되어 있어요. 브라우저 설정에서 허용한 뒤 다시 시도해 주세요.",
'push.notReady': "서버에서 아직 푸시 알림을 사용할 수 없어요.",
'push.error': "알림을 켜지 못했어요. 연결을 확인하고 다시 시도해 주세요.",
'netPill.offlineSync': "오프라인 — 변경 사항은 나중에 동기화돼요",
'netPill.offlineLocal': "오프라인 — 모든 내용이 이 기기에 저장돼 있어요",
'netPill.synced': "동기화됨",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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': "새 공유 목록",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'App installeren',
'settings.installHint': 'Voeg Kino toe aan je startscherm of bureaublad.',
'settings.installed': 'App geïnstalleerd',
'settings.notifs': 'Meldingen',
'settings.notifsHint': 'Kies wat de bel activeert.',
'settings.notifEpisodes': 'Nieuwe afleveringen',
'settings.notifFollows': 'Nieuwe volgers',
'settings.notifAccepted': 'Geaccepteerde verzoeken',
'settings.notifReactions': 'Reacties op mijn recensies',
'notif.new_episode': 'Nieuwe aflevering van {title}',
'notif.new_season': 'Nieuw seizoen van {title}',
'reviews.title': 'Recensies',
'reviews.friends': 'Je vrienden',
'reviews.others': 'Andere leden',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'Nog geen recensies',
'reviews.seeAll': 'Alle recensies bekijken',
'reviews.react': 'Reageren',
'notif.title': 'Meldingen',
'notif.empty': 'Geen meldingen',
'notif.someone': 'Iemand',
'notif.follow_request': 'wil je volgen',
'notif.follow_accepted': 'heeft je verzoek geaccepteerd',
'notif.new_follower': 'volgt je nu',
'notif.reaction': 'heeft op je recensie gereageerd',
'notif.on': 'op {title}',
'home.notifications': 'Meldingen',
'home.notificationsN': '{count} meldingen',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ {count} andere uitdaging",
'challenges.more_other': "+ {count} andere uitdagingen",
// — Notifications push & indicateur hors-ligne —
'push.device': "Meldingen op dit apparaat",
'push.deviceHint': "Ook als de app gesloten is. De keuzes hieronder gelden ook.",
'push.iosInstall': "Voeg op iPhone en iPad Kino eerst toe aan je beginscherm (iOS 16.4 of nieuwer) en open de app via het pictogram om meldingen aan te zetten.",
'push.unsupported': "Deze browser ondersteunt geen pushmeldingen.",
'push.denied': "Meldingen zijn geblokkeerd voor deze site. Sta ze toe in je browserinstellingen en probeer het opnieuw.",
'push.notReady': "Pushmeldingen zijn nog niet beschikbaar op de server.",
'push.error': "Kon meldingen niet aanzetten. Controleer je verbinding en probeer het opnieuw.",
'netPill.offlineSync': "Offline — je wijzigingen worden gesynchroniseerd",
'netPill.offlineLocal': "Offline — alles blijft op dit apparaat bewaard",
'netPill.synced': "Gesynchroniseerd",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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",
-28
View File
@@ -243,14 +243,6 @@ const dict: Translations = {
'settings.installApp': 'Zainstaluj aplikację',
'settings.installHint': 'Dodaj Kino do ekranu głównego lub pulpitu.',
'settings.installed': 'Aplikacja zainstalowana',
'settings.notifs': 'Powiadomienia',
'settings.notifsHint': 'Wybierz, co uruchamia dzwonek.',
'settings.notifEpisodes': 'Nowe odcinki',
'settings.notifFollows': 'Nowi obserwujący',
'settings.notifAccepted': 'Zaakceptowane prośby',
'settings.notifReactions': 'Reakcje na moje recenzje',
'notif.new_episode': 'Nowy odcinek: {title}',
'notif.new_season': 'Nowy sezon: {title}',
'reviews.title': 'Recenzje',
'reviews.friends': 'Twoi znajomi',
'reviews.others': 'Inni użytkownicy',
@@ -259,16 +251,7 @@ const dict: Translations = {
'reviews.none': 'Jeszcze nie ma recenzji',
'reviews.seeAll': 'Zobacz wszystkie recenzje',
'reviews.react': 'Zareaguj',
'notif.title': 'Powiadomienia',
'notif.empty': 'Brak powiadomień',
'notif.someone': 'Ktoś',
'notif.follow_request': 'chce Cię obserwować',
'notif.follow_accepted': 'zaakceptował Twoją prośbę',
'notif.new_follower': 'zaczął Cię obserwować',
'notif.reaction': 'zareagował na Twoją recenzję',
'notif.on': 'w {title}',
'home.notifications': 'Powiadomienia',
'home.notificationsN': 'Powiadomienia: {count}',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1211,13 +1194,6 @@ const dict: Translations = {
'challenges.more_many': "+ {count} innych wyzwań",
'challenges.more_other': "+ {count} innego wyzwania",
// — Notifications push & indicateur hors-ligne —
'push.device': "Powiadomienia na tym urządzeniu",
'push.deviceHint': "Nawet gdy aplikacja jest zamknięta. Poniższe ustawienia też obowiązują.",
'push.iosInstall': "Na iPhonie i iPadzie najpierw dodaj Kino do ekranu początkowego (iOS 16.4 lub nowszy), a potem otwórz aplikację z jej ikony, aby włączyć powiadomienia.",
'push.unsupported': "Ta przeglądarka nie obsługuje powiadomień push.",
'push.denied': "Powiadomienia są zablokowane dla tej witryny. Zezwól na nie w ustawieniach przeglądarki i spróbuj ponownie.",
'push.notReady': "Powiadomienia push nie są jeszcze dostępne na serwerze.",
'push.error': "Nie udało się włączyć powiadomień. Sprawdź połączenie i spróbuj ponownie.",
'netPill.offlineSync': "Offline — zmiany zostaną zsynchronizowane",
'netPill.offlineLocal': "Offline — wszystko zostaje zapisane na tym urządzeniu",
'netPill.synced': "Zsynchronizowano",
@@ -1357,10 +1333,6 @@ const dict: Translations = {
'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",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'Instalar o app',
'settings.installHint': 'Adicione o Kino à tela inicial ou à área de trabalho.',
'settings.installed': 'App instalado',
'settings.notifs': 'Notificações',
'settings.notifsHint': 'Escolhe o que aciona o sino.',
'settings.notifEpisodes': 'Novos episódios',
'settings.notifFollows': 'Novos seguidores',
'settings.notifAccepted': 'Pedidos aceites',
'settings.notifReactions': 'Reações às minhas avaliações',
'notif.new_episode': 'Novo episódio de {title}',
'notif.new_season': 'Nova temporada de {title}',
'reviews.title': 'Avaliações',
'reviews.friends': 'Teus amigos',
'reviews.others': 'Outros membros',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'Ainda sem avaliações',
'reviews.seeAll': 'Ver todas as avaliações',
'reviews.react': 'Reagir',
'notif.title': 'Notificações',
'notif.empty': 'Sem notificações',
'notif.someone': 'Alguém',
'notif.follow_request': 'quer te seguir',
'notif.follow_accepted': 'aceitou teu pedido',
'notif.new_follower': 'começou a te seguir',
'notif.reaction': 'reagiu à tua avaliação',
'notif.on': 'em {title}',
'home.notifications': 'Notificações',
'home.notificationsN': '{count} notificações',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ {count} outro desafio",
'challenges.more_other': "+ {count} outros desafios",
// — Notifications push & indicateur hors-ligne —
'push.device': "Notificações neste dispositivo",
'push.deviceHint': "Mesmo com o app fechado. As opções abaixo também valem.",
'push.iosInstall': "No iPhone e iPad, primeiro adicione o Kino à Tela de Início (iOS 16.4 ou mais recente) e abra o app pelo ícone para ativar as notificações.",
'push.unsupported': "Este navegador não suporta notificações push.",
'push.denied': "As notificações estão bloqueadas para este site. Permita-as nas configurações do navegador e tente de novo.",
'push.notReady': "As notificações push ainda não estão disponíveis no servidor.",
'push.error': "Não foi possível ativar as notificações. Verifique sua conexão e tente de novo.",
'netPill.offlineSync': "Offline — suas alterações serão sincronizadas",
'netPill.offlineLocal': "Offline — tudo fica salvo neste dispositivo",
'netPill.synced': "Sincronizado",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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",
-28
View File
@@ -243,14 +243,6 @@ const dict: Translations = {
'settings.installApp': 'Установить приложение',
'settings.installHint': 'Добавь Kino на главный экран или рабочий стол.',
'settings.installed': 'Приложение установлено',
'settings.notifs': 'Уведомления',
'settings.notifsHint': 'Выбери, что включает колокольчик.',
'settings.notifEpisodes': 'Новые серии',
'settings.notifFollows': 'Новые подписчики',
'settings.notifAccepted': 'Принятые заявки',
'settings.notifReactions': 'Реакции на мои отзывы',
'notif.new_episode': 'Новая серия «{title}»',
'notif.new_season': 'Новый сезон «{title}»',
'reviews.title': 'Отзывы',
'reviews.friends': 'Твои друзья',
'reviews.others': 'Другие участники',
@@ -259,16 +251,7 @@ const dict: Translations = {
'reviews.none': 'Пока нет отзывов',
'reviews.seeAll': 'Смотреть все отзывы',
'reviews.react': 'Отреагировать',
'notif.title': 'Уведомления',
'notif.empty': 'Нет уведомлений',
'notif.someone': 'Кто-то',
'notif.follow_request': 'хочет подписаться на тебя',
'notif.follow_accepted': 'принял(а) твою заявку',
'notif.new_follower': 'подписался(ась) на тебя',
'notif.reaction': 'отреагировал(а) на твой отзыв',
'notif.on': 'к «{title}»',
'home.notifications': 'Уведомления',
'home.notificationsN': 'Уведомлений: {count}',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1211,13 +1194,6 @@ const dict: Translations = {
'challenges.more_many': "+ ещё {count} челленджей",
'challenges.more_other': "+ ещё {count} челленджа",
// — Notifications push & indicateur hors-ligne —
'push.device': "Уведомления на этом устройстве",
'push.deviceHint': "Даже когда приложение закрыто. Настройки ниже тоже действуют.",
'push.iosInstall': "На iPhone и iPad сначала добавьте Kino на экран «Домой» (iOS 16.4 или новее), затем откройте приложение с его значка, чтобы включить уведомления.",
'push.unsupported': "Этот браузер не поддерживает push-уведомления.",
'push.denied': "Уведомления для этого сайта заблокированы. Разрешите их в настройках браузера и повторите попытку.",
'push.notReady': "Push-уведомления пока недоступны на сервере.",
'push.error': "Не удалось включить уведомления. Проверьте подключение и повторите попытку.",
'netPill.offlineSync': "Нет сети — изменения будут синхронизированы",
'netPill.offlineLocal': "Нет сети — всё сохранено на этом устройстве",
'netPill.synced': "Синхронизировано",
@@ -1357,10 +1333,6 @@ const dict: Translations = {
'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': "Новый общий список",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'ติดตั้งแอป',
'settings.installHint': 'เพิ่ม Kino ไปที่หน้าจอหลักหรือเดสก์ท็อปของคุณ',
'settings.installed': 'ติดตั้งแอปแล้ว',
'settings.notifs': 'การแจ้งเตือน',
'settings.notifsHint': 'เลือกสิ่งที่จะทำให้กระดิ่งเตือน',
'settings.notifEpisodes': 'ตอนใหม่',
'settings.notifFollows': 'ผู้ติดตามใหม่',
'settings.notifAccepted': 'คำขอที่ยอมรับแล้ว',
'settings.notifReactions': 'รีแอกชันต่อรีวิวของฉัน',
'notif.new_episode': 'ตอนใหม่ของ {title}',
'notif.new_season': 'ซีซันใหม่ของ {title}',
'reviews.title': 'รีวิว',
'reviews.friends': 'เพื่อนของคุณ',
'reviews.others': 'สมาชิกอื่น',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'ยังไม่มีรีวิว',
'reviews.seeAll': 'ดูรีวิวทั้งหมด',
'reviews.react': 'แสดงความรู้สึก',
'notif.title': 'การแจ้งเตือน',
'notif.empty': 'ไม่มีการแจ้งเตือน',
'notif.someone': 'มีคน',
'notif.follow_request': 'ต้องการติดตามคุณ',
'notif.follow_accepted': 'ยอมรับคำขอของคุณ',
'notif.new_follower': 'เริ่มติดตามคุณ',
'notif.reaction': 'แสดงความรู้สึกต่อรีวิวของคุณ',
'notif.on': 'ใน {title}',
'home.notifications': 'การแจ้งเตือน',
'home.notificationsN': '{count} การแจ้งเตือน',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ อีก {count} ชาเลนจ์",
'challenges.more_other': "+ อีก {count} ชาเลนจ์",
// — Notifications push & indicateur hors-ligne —
'push.device': "การแจ้งเตือนบนอุปกรณ์นี้",
'push.deviceHint': "แม้ปิดแอปอยู่ ตัวเลือกด้านล่างก็มีผลด้วย",
'push.iosInstall': "บน iPhone และ iPad ให้เพิ่ม Kino ไปยังหน้าจอโฮมก่อน (iOS 16.4 ขึ้นไป) แล้วเปิดแอปจากไอคอนเพื่อเปิดการแจ้งเตือน",
'push.unsupported': "เบราว์เซอร์นี้ไม่รองรับการแจ้งเตือนแบบพุช",
'push.denied': "การแจ้งเตือนถูกบล็อกสำหรับเว็บไซต์นี้ อนุญาตในการตั้งค่าเบราว์เซอร์แล้วลองอีกครั้ง",
'push.notReady': "เซิร์ฟเวอร์ยังไม่พร้อมสำหรับการแจ้งเตือนแบบพุช",
'push.error': "เปิดการแจ้งเตือนไม่สำเร็จ ตรวจสอบการเชื่อมต่อแล้วลองอีกครั้ง",
'netPill.offlineSync': "ออฟไลน์ — การเปลี่ยนแปลงจะซิงค์ภายหลัง",
'netPill.offlineLocal': "ออฟไลน์ — ทุกอย่างยังบันทึกอยู่ในอุปกรณ์นี้",
'netPill.synced': "ซิงค์แล้ว",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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': "รายการที่แชร์ใหม่",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'Uygulamayı yükle',
'settings.installHint': 'Kino’yu ana ekranına veya masaüstüne ekle.',
'settings.installed': 'Uygulama yüklendi',
'settings.notifs': 'Bildirimler',
'settings.notifsHint': 'Zili neyin tetikleyeceğini seç.',
'settings.notifEpisodes': 'Yeni bölümler',
'settings.notifFollows': 'Yeni takipçiler',
'settings.notifAccepted': 'Kabul edilen istekler',
'settings.notifReactions': 'Yorumlarıma tepkiler',
'notif.new_episode': '{title} yeni bölüm',
'notif.new_season': '{title} yeni sezon',
'reviews.title': 'Yorumlar',
'reviews.friends': 'Arkadaşların',
'reviews.others': 'Diğer üyeler',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'Henüz yorum yok',
'reviews.seeAll': 'Tüm yorumları gör',
'reviews.react': 'Tepki ver',
'notif.title': 'Bildirimler',
'notif.empty': 'Bildirim yok',
'notif.someone': 'Biri',
'notif.follow_request': 'seni takip etmek istiyor',
'notif.follow_accepted': 'isteğini kabul etti',
'notif.new_follower': 'seni takip etmeye başladı',
'notif.reaction': 'yorumuna tepki verdi',
'notif.on': '{title} için',
'home.notifications': 'Bildirimler',
'home.notificationsN': '{count} bildirim',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ {count} hedef daha",
'challenges.more_other': "+ {count} hedef daha",
// — Notifications push & indicateur hors-ligne —
'push.device': "Bu cihazda bildirimler",
'push.deviceHint': "Uygulama kapalıyken bile. Aşağıdaki seçimler de geçerlidir.",
'push.iosInstall': "iPhone ve iPad’de önce Kino’yu Ana Ekran’a ekle (iOS 16.4 veya üstü), ardından bildirimleri açmak için uygulamayı simgesinden aç.",
'push.unsupported': "Bu tarayıcı anlık bildirimleri desteklemiyor.",
'push.denied': "Bu site için bildirimler engellendi. Tarayıcı ayarlarından izin ver ve tekrar dene.",
'push.notReady': "Anlık bildirimler sunucuda henüz kullanılamıyor.",
'push.error': "Bildirimler açılamadı. Bağlantını kontrol edip tekrar dene.",
'netPill.offlineSync': "Çevrimdışı — değişikliklerin eşitlenecek",
'netPill.offlineLocal': "Çevrimdışı — her şey bu cihazda kayıtlı kalır",
'netPill.synced': "Eşitlendi",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': 'Cài đặt ứng dụng',
'settings.installHint': 'Thêm Kino vào màn hình chính hoặc màn hình nền của bạn.',
'settings.installed': 'Đã cài ứng dụng',
'settings.notifs': 'Thông báo',
'settings.notifsHint': 'Chọn điều kích hoạt chuông.',
'settings.notifEpisodes': 'Tập mới',
'settings.notifFollows': 'Người theo dõi mới',
'settings.notifAccepted': 'Yêu cầu đã chấp nhận',
'settings.notifReactions': 'Cảm xúc với đánh giá của tôi',
'notif.new_episode': 'Tập mới của {title}',
'notif.new_season': 'Mùa mới của {title}',
'reviews.title': 'Đánh giá',
'reviews.friends': 'Bạn bè của bạn',
'reviews.others': 'Thành viên khác',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': 'Chưa có đánh giá',
'reviews.seeAll': 'Xem tất cả đánh giá',
'reviews.react': 'Bày tỏ cảm xúc',
'notif.title': 'Thông báo',
'notif.empty': 'Không có thông báo',
'notif.someone': 'Ai đó',
'notif.follow_request': 'muốn theo dõi bạn',
'notif.follow_accepted': 'đã chấp nhận yêu cầu của bạn',
'notif.new_follower': 'đã theo dõi bạn',
'notif.reaction': 'đã bày tỏ cảm xúc với đánh giá của bạn',
'notif.on': 'về {title}',
'home.notifications': 'Thông báo',
'home.notificationsN': '{count} thông báo',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ {count} thử thách khác",
'challenges.more_other': "+ {count} thử thách khác",
// — Notifications push & indicateur hors-ligne —
'push.device': "Thông báo trên thiết bị này",
'push.deviceHint': "Ngay cả khi ứng dụng đã đóng. Các lựa chọn bên dưới cũng được áp dụng.",
'push.iosInstall': "Trên iPhone và iPad, trước tiên hãy thêm Kino vào Màn hình chính (iOS 16.4 trở lên), sau đó mở ứng dụng từ biểu tượng để bật thông báo.",
'push.unsupported': "Trình duyệt này không hỗ trợ thông báo đẩy.",
'push.denied': "Thông báo đã bị chặn cho trang này. Hãy cho phép trong cài đặt trình duyệt rồi thử lại.",
'push.notReady': "Máy chủ chưa hỗ trợ thông báo đẩy.",
'push.error': "Không thể bật thông báo. Kiểm tra kết nối rồi thử lại.",
'netPill.offlineSync': "Ngoại tuyến — thay đổi của bạn sẽ được đồng bộ",
'netPill.offlineLocal': "Ngoại tuyến — mọi thứ vẫn được lưu trên thiết bị này",
'netPill.synced': "Đã đồng bộ",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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",
-28
View File
@@ -239,14 +239,6 @@ const dict: Translations = {
'settings.installApp': '安装应用',
'settings.installHint': '将 Kino 添加到主屏幕或桌面。',
'settings.installed': '应用已安装',
'settings.notifs': '通知',
'settings.notifsHint': '选择触发铃铛的内容。',
'settings.notifEpisodes': '新剧集',
'settings.notifFollows': '新粉丝',
'settings.notifAccepted': '已接受的请求',
'settings.notifReactions': '对我评价的回应',
'notif.new_episode': '《{title}》有新一集',
'notif.new_season': '《{title}》有新一季',
'reviews.title': '评价',
'reviews.friends': '你的好友',
'reviews.others': '其他用户',
@@ -255,16 +247,7 @@ const dict: Translations = {
'reviews.none': '还没有评价',
'reviews.seeAll': '查看全部评价',
'reviews.react': '回应',
'notif.title': '通知',
'notif.empty': '暂无通知',
'notif.someone': '有人',
'notif.follow_request': '想关注你',
'notif.follow_accepted': '接受了你的请求',
'notif.new_follower': '开始关注你',
'notif.reaction': '回应了你的评价',
'notif.on': '关于《{title}》',
'home.notifications': '通知',
'home.notificationsN': '{count} 条通知',
'settings.admin': 'Administration',
'admin.title': 'Administration',
'admin.tabOverview': 'Overview',
@@ -1075,13 +1058,6 @@ const dict: Translations = {
'challenges.more_one': "+ 另外 {count} 个挑战",
'challenges.more_other': "+ 另外 {count} 个挑战",
// — Notifications push & indicateur hors-ligne —
'push.device': "此设备上的通知",
'push.deviceHint': "即使应用已关闭也会提醒。下方的选项同样适用。",
'push.iosInstall': "在 iPhone 和 iPad 上,请先将 Kino 添加到主屏幕(iOS 16.4 或更高版本),再从图标打开应用以开启通知。",
'push.unsupported': "此浏览器不支持推送通知。",
'push.denied': "此网站的通知已被阻止。请在浏览器设置中允许后重试。",
'push.notReady': "服务器暂未开放推送通知。",
'push.error': "无法开启通知。请检查网络连接后重试。",
'netPill.offlineSync': "离线 — 你的修改将稍后同步",
'netPill.offlineLocal': "离线 — 所有内容都保存在此设备上",
'netPill.synced': "已同步",
@@ -1221,10 +1197,6 @@ const dict: Translations = {
'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': "新建共享片单",
+1 -6
View File
@@ -1,5 +1,5 @@
import { t } from '../i18n'
import type { BackupFile, Criteria, CustomList, MediaItem, MediaType, NotifPrefs, Settings, TopCategory, TopEntry, WatchStatus } from '../types'
import type { BackupFile, Criteria, CustomList, MediaItem, MediaType, Settings, TopCategory, TopEntry, WatchStatus } from '../types'
import { ALL_TOP_CATEGORIES, MEDIA_TYPES, STATUSES } from './constants'
import { episodeCap } from './franchise'
import { convertLegacyBackup, isLegacyBackup } from './legacyImport'
@@ -154,11 +154,6 @@ export function normalizeSettings(raw: unknown): Partial<Settings> | undefined {
if (Array.isArray(raw.topCategories)) out.topCategories = ALL_TOP_CATEGORIES.filter((c) => (raw.topCategories as unknown[]).includes(c))
if (isHexColor(raw.accentColor)) out.accentColor = raw.accentColor.toLowerCase()
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', 'comments', 'lists'] as const) if (typeof raw.notifPrefs[k] === 'boolean') np[k] = raw.notifPrefs[k] as boolean
out.notifPrefs = np
}
const challenges = normalizeChallenges(raw.challenges)
if (challenges) out.challenges = challenges
if (Array.isArray(raw.statsHiddenMonths)) {
-108
View File
@@ -1,108 +0,0 @@
import { t } from '../../i18n'
import { cleanText, isPlainObject, safeIso } from '../security'
import { cloudFetch } from './api'
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'
| 'review_comment'
| 'shared_list_invite'
export interface AppNotification {
id: number
kind: NotificationKind
created_at: string
read_at: string | null
emoji: string | null
item_id: string | null
/** Numéro du dernier épisode sorti (épisodes) */
episode: number | null
/** 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, 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). */
export interface EpisodeNotice {
item_id: string
kind: 'new_episode' | 'new_season'
/** Dernier épisode sorti */
episode: number
/** Nombre de nouveaux épisodes */
count: number
}
/** Enregistre les nouveaux épisodes des séries suivies (dédoublonné côté serveur). Renvoie le nombre créé. */
export async function addEpisodeNotifications(list: EpisodeNotice[]): Promise<number> {
if (!list.length) return 0
try {
const n = await rpc<number>('add_episode_notifications', { p_list: list })
return typeof n === 'number' ? n : 0
} catch {
return 0
}
}
async function rpc<T>(name: string, args: Record<string, unknown> = {}): Promise<T> {
const res = await cloudFetch(`/rest/v1/rpc/${name}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(args),
})
if (!res.ok) throw new Error(t('social.err.server', { status: res.status }))
return res.json() as Promise<T>
}
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. */
function toNotification(v: unknown): AppNotification | null {
if (!isPlainObject(v) || typeof v.id !== 'number' || !KINDS.includes(v.kind as NotificationKind)) return null
const created = safeIso(v.created_at)
if (!created) return null
const a = isPlainObject(v.actor) ? v.actor : null
const username = a && typeof a.username === 'string' && /^[a-z0-9_]{3,20}$/.test(a.username) ? a.username : null
return {
id: v.id,
kind: v.kind as NotificationKind,
created_at: created,
read_at: safeIso(v.read_at) ?? null,
emoji: cleanText(v.emoji, 8) ?? null,
item_id: cleanText(v.item_id, 64) ?? null,
episode: num(v.episode),
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,
}
}
export const listNotifications = async (offset = 0): Promise<AppNotification[]> => {
const raw = await rpc<unknown>('get_notifications', { p_offset: offset })
return (Array.isArray(raw) ? raw : []).map(toNotification).filter((n): n is AppNotification => n !== null)
}
export async function unreadCount(): Promise<number> {
try {
const n = await rpc<number>('notifications_unread')
return typeof n === 'number' ? n : 0
} catch {
return 0
}
}
export async function markNotificationsRead(): Promise<void> {
await rpc('mark_notifications_read')
}
+1 -1
View File
@@ -15,7 +15,7 @@ import { cloudFetch } from './api'
* En cas de conflit, la modification la plus récente gagne (vérifié aussi par la base).
*/
export type SyncedSettings = Pick<Settings, 'ratingScale' | 'topCategories' | 'accentColor' | 'themeMode' | 'notifPrefs' | 'challenges' | 'statsHiddenMonths'>
export type SyncedSettings = Pick<Settings, 'ratingScale' | 'topCategories' | 'accentColor' | 'themeMode' | 'challenges' | 'statsHiddenMonths'>
export interface SyncHooks {
getLists: () => CustomList[]
+12 -201
View File
@@ -1,210 +1,21 @@
import { getLang } from '../i18n'
import { cloudFetch } from './cloud/api'
import { cloudEnabled } from './cloud/config'
import { detectPlatform } from './pwa'
import { scopedKey } from './scope'
import { isPlainObject, storageGet, storageSet } from './security'
/**
* Notifications push (Web Push) sur cet appareil :
* - la permission n'est demandée qu'au clic sur l'interrupteur (jamais au chargement) ;
* - l'abonnement du navigateur est enregistré sur le serveur (register_push_subscription) ;
* - le serveur envoie ensuite les notifications de la cloche, même app fermée.
* Les notifications ont été retirées de l'app (novembre 2026).
* Un appareil qui les avait activées garde un abonnement dans son navigateur : on le résilie
* au lancement, pour qu'il ne reste rien. Le serveur, lui, n'en envoie plus aucune.
*/
export type PushSupport = 'ok' | 'unsupported' | 'needs-install'
export type PushState = 'unsupported' | 'needs-install' | 'denied' | 'off' | 'on'
export class PushError extends Error {
constructor(public code: 'denied' | 'not-ready' | 'failed') {
super(code)
}
}
/** Dernier enregistrement réussi (par compte) */
const storeKey = () => scopedKey('push')
const REFRESH_MS = 7 * 24 * 3600 * 1000
function isStandalone(): boolean {
return window.matchMedia?.('(display-mode: standalone)').matches || (navigator as { standalone?: boolean }).standalone === true
}
/** Ce navigateur sait-il recevoir des notifications push ? (iPhone : seulement l'app installée, iOS 16.4+) */
export function pushSupport(): PushSupport {
if (!cloudEnabled || typeof window === 'undefined') return 'unsupported'
const api = 'serviceWorker' in navigator && 'PushManager' in window && 'Notification' in window
if (detectPlatform() === 'ios' && (!isStandalone() || !api)) return 'needs-install'
return api ? 'ok' : 'unsupported'
}
function withTimeout<T>(p: Promise<T>, ms: number): Promise<T> {
return new Promise((resolve, reject) => {
const timer = setTimeout(() => reject(new PushError('failed')), ms)
p.then(
(v) => {
clearTimeout(timer)
resolve(v)
},
(e) => {
clearTimeout(timer)
reject(e)
},
)
})
}
/** Service worker actif (absent en mode développement : on n'attend pas indéfiniment). */
const registration = () => withTimeout(navigator.serviceWorker.ready, 8000)
async function currentSubscription(): Promise<PushSubscription | null> {
export async function dropPushSubscription(): Promise<void> {
try {
if (!('serviceWorker' in navigator) || !('PushManager' in window)) return
const reg = await navigator.serviceWorker.getRegistration()
return (await reg?.pushManager.getSubscription()) ?? null
}
export async function getPushState(): Promise<PushState> {
const support = pushSupport()
if (support !== 'ok') return support
if (Notification.permission === 'denied') return 'denied'
if (Notification.permission !== 'granted') return 'off'
try {
return (await currentSubscription()) ? 'on' : 'off'
const sub = await reg?.pushManager.getSubscription()
await sub?.unsubscribe()
} catch {
return 'off'
/* rien à faire */
}
}
function b64urlToBytes(s: string): Uint8Array<ArrayBuffer> {
const b64 = s.replace(/-/g, '+').replace(/_/g, '/')
const bin = atob(b64 + '='.repeat((4 - (b64.length % 4)) % 4))
const out = new Uint8Array(new ArrayBuffer(bin.length))
for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i)
return out
}
function bytesToB64url(buf: ArrayBuffer | null): string {
if (!buf) return ''
let s = ''
for (const b of new Uint8Array(buf)) s += String.fromCharCode(b)
return btoa(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '')
}
/** Clé publique VAPID du serveur (la clé privée ne quitte jamais Supabase). */
async function serverKey(): Promise<string> {
let res: Response
// Ancien état local des notifications push
try {
res = await cloudFetch('/functions/v1/send-push')
for (const k of Object.keys(localStorage)) if (/^azuucine:(?:[^:]+:)?push$/.test(k)) localStorage.removeItem(k)
} catch {
throw new PushError('failed')
/* stockage indisponible */
}
if (res.status === 404 || res.status === 503) throw new PushError('not-ready')
if (!res.ok) throw new PushError('failed')
const body = (await res.json().catch(() => null)) as unknown
const key = isPlainObject(body) && typeof body.publicKey === 'string' ? body.publicKey : ''
if (!/^B[A-Za-z0-9_-]{86}$/.test(key)) throw new PushError('not-ready')
return key
}
/** Petit libellé de l'appareil (« Chrome · Android ») pour s'y retrouver côté serveur. */
function deviceLabel(): string {
const ua = navigator.userAgent
const browser = /Edg\//.test(ua) ? 'Edge' : /Firefox\//.test(ua) ? 'Firefox' : /Chrome\//.test(ua) ? 'Chrome' : /Safari\//.test(ua) ? 'Safari' : 'Web'
const p = detectPlatform()
const os = p === 'ios' ? 'iOS' : p === 'android' ? 'Android' : /Windows/.test(ua) ? 'Windows' : /Mac/.test(ua) ? 'macOS' : /Linux|CrOS/.test(ua) ? 'Linux' : ''
return os ? `${browser} · ${os}` : browser
}
async function register(sub: PushSubscription): Promise<void> {
const lang = getLang()
const res = await cloudFetch('/rest/v1/rpc/register_push_subscription', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
p_endpoint: sub.endpoint,
p_p256dh: bytesToB64url(sub.getKey('p256dh')),
p_auth: bytesToB64url(sub.getKey('auth')),
p_lang: lang,
p_ua: deviceLabel(),
}),
})
if (res.status === 404) throw new PushError('not-ready')
if (!res.ok) throw new PushError('failed')
storageSet(storeKey(), JSON.stringify({ endpoint: sub.endpoint, lang, at: Date.now() }))
}
/** Active les notifications push sur cet appareil. À appeler uniquement depuis un clic. */
export async function enablePush(): Promise<PushState> {
const support = pushSupport()
if (support !== 'ok') return support
const permission = await Notification.requestPermission()
if (permission === 'denied') throw new PushError('denied')
if (permission !== 'granted') return 'off'
const key = await serverKey()
const reg = await registration()
let sub = await reg.pushManager.getSubscription()
// Abonnement créé avec une autre clé serveur (clés VAPID changées) : on le refait
if (sub && sub.options.applicationServerKey && bytesToB64url(sub.options.applicationServerKey) !== key) {
await sub.unsubscribe().catch(() => false)
sub = null
}
if (!sub) {
try {
sub = await reg.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey: b64urlToBytes(key) })
} catch {
throw new PushError(Notification.permission === 'denied' ? 'denied' : 'failed')
}
}
try {
await register(sub)
} catch (e) {
await sub.unsubscribe().catch(() => false)
throw e instanceof PushError ? e : new PushError('failed')
}
return 'on'
}
/** Coupe les notifications push sur cet appareil (et retire l'appareil du serveur). */
export async function disablePush(): Promise<void> {
if (pushSupport() !== 'ok') return
const sub = await currentSubscription().catch(() => null)
storageSet(storeKey(), null)
if (!sub) return
try {
await cloudFetch('/rest/v1/rpc/unregister_push_subscription', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ p_endpoint: sub.endpoint }),
})
} catch {
/* hors-ligne : le serveur oubliera l'abonnement au premier envoi refusé (410) */
}
await sub.unsubscribe().catch(() => false)
}
/** Désabonne seulement le navigateur (compte supprimé : le serveur a déjà tout effacé). */
export async function forgetPushLocally(): Promise<void> {
storageSet(storeKey(), null)
if (pushSupport() !== 'ok') return
const sub = await currentSubscription().catch(() => null)
await sub?.unsubscribe().catch(() => false)
}
/**
* Au lancement : réenregistre l'abonnement si le navigateur l'a renouvelé, si la langue a changé,
* ou une fois par semaine (le serveur garde ainsi les appareils réellement utilisés).
*/
export async function keepPushFresh(): Promise<void> {
if (pushSupport() !== 'ok' || Notification.permission !== 'granted' || !navigator.onLine) return
const sub = await currentSubscription().catch(() => null)
if (!sub) return
let saved: unknown = null
try {
saved = JSON.parse(storageGet(storeKey()) ?? 'null')
} catch {
/* ignore */
}
// Pas d'enregistrement connu : l'abonnement n'a pas été créé par ce compte, on n'y touche pas
if (!isPlainObject(saved)) return
const fresh = saved.endpoint === sub.endpoint && saved.lang === getLang() && typeof saved.at === 'number' && Date.now() - saved.at < REFRESH_MS
if (!fresh) await register(sub).catch(() => {})
}
+2 -30
View File
@@ -1,6 +1,6 @@
import { useSocial } from '../components/social/SocialProvider'
import { t } from '../i18n'
import { Bell, CalendarDays, Dices, Plus } from 'lucide-react'
import { CalendarDays, Dices, Plus } from 'lucide-react'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { TYPE_BY_VALUE } from '../lib/constants'
import Avatar from '../components/social/Avatar'
@@ -14,7 +14,6 @@ import { progressView } from '../lib/rewatch'
import type { Tab } from '../components/BottomNav'
import { EmptyState, LinkArrow, PageHeader, SectionTitle, StatTile } from '../components/ui'
import { CACHE_EVENT, isCaughtUp, loadAiring, needsCheck, refreshAiring, saveAiring, trackable } from '../lib/airing'
import { addEpisodeNotifications } from '../lib/cloud/notifications'
import { useOnResume } from '../lib/onResume'
import { calendarEvents } from '../lib/releases'
import { computeStats } from '../lib/stats'
@@ -80,21 +79,6 @@ export default function HomePage({ onOpen, onAdd, onNavigate, onRoulette, onCale
if (info.backdrop && !i.backdrop) patch.backdrop = info.backdrop
return Object.keys(patch).length ? [{ id: i.id, patch }] : []
})
// Notifications : on envoie le dernier épisode sorti de chaque série encore en diffusion ;
// le serveur retient le précédent et ne signale que ce qui est sorti depuis (le passé n'est pas « nouveau »).
if (social.enabled) {
const notices = trackable(items).flatMap((i) => {
const info = next[i.id]
if (!info || info.ended || info.aired < 1 || i.status === 'abandonne') return []
const kind = i.status === 'termine' ? ('new_season' as const) : ('new_episode' as const)
return [{ item_id: i.id, kind, episode: info.aired, count: Math.max(1, info.aired - i.episodesWatched) }]
})
void (async () => {
let created = 0
for (let k = 0; k < notices.length; k += 50) created += await addEpisodeNotifications(notices.slice(k, k + 50))
if (created > 0) void social.refresh()
})()
}
if (patches.length) return patchMany(patches)
})
.catch(() => {})
@@ -102,7 +86,7 @@ export default function HomePage({ onOpen, onAdd, onNavigate, onRoulette, onCale
airingRunning.current = false
setCheckingAiring(false)
})
}, [patchMany, social])
}, [patchMany])
useEffect(() => {
if (loading || airingStarted.current) return
airingStarted.current = true
@@ -171,18 +155,6 @@ export default function HomePage({ onOpen, onAdd, onNavigate, onRoulette, onCale
<span className="absolute -end-1 -top-1 grid min-w-5 place-items-center rounded-full bg-accent-fill px-1 text-[10px] font-bold text-on-accent">{soon}</span>
)}
</button>
{social.enabled && (
<button
onClick={social.openNotifications}
className="relative grid size-11 shrink-0 place-items-center rounded-full border border-line text-ink-2 transition-colors active:bg-surface-2"
aria-label={social.unread > 0 ? t('home.notificationsN', { count: social.unread }) : t('home.notifications')}
>
<Bell size={20} />
{social.unread > 0 && (
<span className="absolute -end-1 -top-1 grid min-w-5 place-items-center rounded-full bg-accent-fill px-1 text-[10px] font-bold text-on-accent">{social.unread}</span>
)}
</button>
)}
{social.enabled && (
<button onClick={() => (social.me ? social.openProfile(social.me.username) : social.openSearch())} className="relative shrink-0 rounded-full" aria-label={t('social.myProfile')}>
<Avatar url={social.me?.avatarUrl} name={social.me?.displayName ?? '?'} size={44} />
-38
View File
@@ -3,7 +3,6 @@ import { LanguageSelect } from '../i18n/react'
import { Check, Download, ExternalLink, Eye, EyeOff, HardDrive, Import, ShieldCheck, Smartphone, Trash2, Upload, UserX } from 'lucide-react'
import { useEffect, useRef, useState, type ReactNode } from 'react'
import AccountSection from '../components/AccountSection'
import PushToggle from '../components/PushToggle'
import ConfirmDialog from '../components/ConfirmDialog'
import ImportWizard from '../components/ImportWizard'
import { PageHeader, SectionTitle } from '../components/ui'
@@ -14,7 +13,6 @@ import { ALL_TOP_CATEGORIES, TOP_CATEGORIES } from '../lib/constants'
import { isHexColor, THEME_MODES, THEME_PRESETS } from '../lib/theme'
import { detectPlatform, useInstallPrompt } from '../lib/pwa'
import { isAdmin } from '../lib/cloud/admin'
import type { NotifPrefs } from '../types'
import { cx } from '../lib/utils'
import { useEscape } from '../lib/escape'
import { useBackToClose } from '../lib/backNav'
@@ -25,15 +23,6 @@ import { alertsSummary, useAdminAlerts } from '../components/moderation/useAdmin
type Message = { kind: 'ok' | 'error'; text: string }
const NOTIF_PREFS: { key: keyof NotifPrefs; readonly label: () => string }[] = [
{ key: 'episodes', label: () => t('settings.notifEpisodes') },
{ 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 }) {
return (
<button onClick={onClick} className={cx('flex w-full items-center gap-3.5 px-4 py-4 text-start transition-colors active:bg-surface-2', danger && 'text-accent')}>
@@ -324,33 +313,6 @@ export default function SettingsPage({ onOpenAdmin }: { onOpenAdmin: () => void
</div>
)}
{account && (
<>
<SectionTitle>{t('settings.notifs')}</SectionTitle>
<p className="mb-3 text-xs text-ink-3">{t('settings.notifsHint')}</p>
<PushToggle />
<div className="card divide-y divide-line overflow-hidden">
{NOTIF_PREFS.map(({ key, label }) => {
const on = settings.notifPrefs?.[key] !== false
return (
<button
key={key}
type="button"
role="switch"
aria-checked={on}
onClick={() => updateSettings({ notifPrefs: { ...settings.notifPrefs, [key]: !on } })}
className="flex w-full items-center gap-3.5 px-4 py-3.5 text-start"
>
<span className="flex-1 text-sm font-medium">{label()}</span>
<span className={cx('relative h-6 w-11 shrink-0 rounded-full transition-colors', on ? 'bg-accent-fill' : 'border border-line-strong bg-surface-2')}>
<span className={cx('absolute top-0.5 size-5 rounded-full bg-ink transition-all', on ? 'start-[22px] bg-on-accent' : 'start-0.5')} />
</span>
</button>
)
})}
</div>
</>
)}
<SectionTitle>{t('settings.databases')}</SectionTitle>
<div className="card space-y-4 p-4">
+3 -7
View File
@@ -10,7 +10,6 @@ import { createSync, type SyncEngine, type SyncStatus } from './lib/cloud/sync'
import { deleteDatabase, readOtherDatabase } from './lib/db'
import { cloudFetch } from './lib/cloud/api'
import { signOut } from './lib/cloud/auth'
import { disablePush, forgetPushLocally } from './lib/push'
import { dbNameFor, scopedKey } from './lib/scope'
import { isPlainObject, LIMITS, readStorage, storageGet, storageSet } from './lib/security'
import { mediaDB, requestPersistentStorage } from './lib/db'
@@ -207,8 +206,8 @@ export function MediaProvider({
getLists: () => listsRef.current,
applyLists: (next) => setLists(() => next, true),
getSettings: () => {
const { ratingScale, topCategories, accentColor, themeMode, notifPrefs, challenges, statsHiddenMonths } = settingsRef.current
return { ratingScale, topCategories, accentColor, themeMode, notifPrefs, challenges, statsHiddenMonths }
const { ratingScale, topCategories, accentColor, themeMode, challenges, statsHiddenMonths } = settingsRef.current
return { ratingScale, topCategories, accentColor, themeMode, challenges, statsHiddenMonths }
},
applySettings: (patch) => updateSettingsRef.current(patch, true),
itemsChanged: () => void reloadItems(),
@@ -249,7 +248,7 @@ export function MediaProvider({
}, [settings.themeMode])
const updateSettings = useCallback((patch: Partial<Settings>, silent = false) => {
if (!silent && syncRef.current && ('ratingScale' in patch || 'topCategories' in patch || 'accentColor' in patch || 'themeMode' in patch || 'notifPrefs' in patch || 'challenges' in patch || 'statsHiddenMonths' in patch)) syncRef.current.markSettings()
if (!silent && syncRef.current && ('ratingScale' in patch || 'topCategories' in patch || 'accentColor' in patch || 'themeMode' in patch || 'challenges' in patch || 'statsHiddenMonths' in patch)) syncRef.current.markSettings()
setSettings((prev) => {
const next = { ...prev, ...patch }
try {
@@ -502,8 +501,6 @@ export function MediaProvider({
if (engine && navigator.onLine) await engine.syncNow()
if (!force && engine && engine.status().pending > 0) return 'pending'
engine?.stop()
// Cet appareil ne doit plus recevoir les notifications push de ce compte
await disablePush().catch(() => {})
await wipeAccountFromDevice(userId)
await signOut()
return 'done'
@@ -516,7 +513,6 @@ export function MediaProvider({
})
if (!res.ok) throw new Error(res.status === 429 ? t('account.err.deleteRate') : t('account.err.delete'))
syncRef.current?.stop()
await forgetPushLocally().catch(() => {})
await wipeAccountFromDevice(userId)
await signOut()
},
-18
View File
@@ -109,8 +109,6 @@ export interface Settings {
accentColor: string
/** Apparence (clair, sombre, nuit, bleu nuit étoilé). « auto » suit le navigateur. */
themeMode: ThemeMode
/** Notifications reçues (true par défaut si absent). Nécessite un compte. */
notifPrefs?: NotifPrefs
/** Défis de visionnage (synchronisés avec les réglages, privés). */
challenges?: Challenge[]
/** Mois masqués dans la courbe des stats (AAAA-MM), ex. le mois où j'ai tout ajouté d'un coup. */
@@ -133,22 +131,6 @@ export interface Challenge {
archived?: boolean
}
/** Types de notifications que l'on choisit de recevoir (true par défaut). */
export interface NotifPrefs {
/** Nouveaux épisodes / saisons des séries suivies */
episodes?: boolean
/** Nouveaux abonnés et demandes d'abonnement */
follows?: boolean
/** Demandes d'abonnement acceptées */
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 {
id: string
name: string
-111
View File
@@ -1,111 +0,0 @@
# Notifications push (Web Push) — mise en service
Les notifications de la cloche (nouveaux abonnés, demandes acceptées, réactions, nouveaux épisodes…)
peuvent aussi arriver **sur le téléphone / l'ordinateur, même app fermée**.
```
nouvelle ligne dans public.notifications
└─ déclencheur notifications_push (SQL) ── pg_net ──► fonction « send-push » (en-tête x-push-secret)
├─ push_claim() : notifications non envoyées + appareils
├─ préférences (notifPrefs) appliquées, textes traduits, regroupés
├─ chiffrement aes128gcm + jeton VAPID ──► FCM / Mozilla / Apple / Windows
└─ push_done() : appareils expirés (404/410) supprimés
```
Rien ne casse tant que ce n'est pas configuré : sans secrets ni Vault, le déclencheur ne fait rien,
la cloche fonctionne comme avant et l'interrupteur des Réglages affiche « pas encore disponible ».
---
## 1. Base de données (SQL Editor)
Prérequis déjà appliqués : `20261007120000_social_notifications.sql` et `20261008140000_episode_notifications_fix.sql`.
1. Supabase → **SQL Editor** → coller `supabase/A_COLLER_2026-10-09.sql` (contient `20261009150000_web_push.sql` et l'adresse `azuu_push_url` dans Vault) → **Run**.
- Elle active l'extension **pg_net** (`create extension if not exists pg_net`). Si l'éditeur refuse,
l'activer à la main : **Database → Extensions → pg_net → Enable**, puis relancer le fichier.
- Le fichier est idempotent : on peut le relancer sans risque.
## 2. Clés VAPID et secret partagé (sur ton PC)
```bash
node scripts/gen-vapid.mjs
```
Le script affiche les commandes à copier. **Ne jamais committer ces valeurs** (ni dans `.env`, ni en `VITE_…`).
La clé publique n'est pas secrète (l'app la lit via la fonction), la clé privée et le secret du webhook le sont.
## 3. Secrets des fonctions
Supabase → **Edge Functions → Secrets** (ou `supabase secrets set …`) :
| Nom | Valeur |
| --- | --- |
| `VAPID_PUBLIC_KEY` | clé publique affichée par le script (87 caractères, commence par `B`) |
| `VAPID_PRIVATE_KEY` | clé privée affichée par le script (43 caractères) |
| `VAPID_SUBJECT` | `mailto:ton-adresse@…` (contact pour les services push) |
| `PUSH_WEBHOOK_SECRET` | secret aléatoire affiché par le script (≥ 32 caractères) |
`SUPABASE_URL` et `SUPABASE_SERVICE_ROLE_KEY` sont fournis automatiquement. `ALLOWED_ORIGINS`
(déjà en place pour `tmdb`) sert aussi ici pour la lecture de la clé publique depuis le site.
## 4. Déployer la fonction
> ✅ Déjà fait le 9 oct. 2026 (version 1 déployée par Claude). À refaire seulement si `functions/send-push` change.
```bash
supabase functions deploy send-push --project-ref qfgnxonqwldcfdjqhhjz
```
`supabase/config.toml` contient `verify_jwt = false` pour `send-push` : la base l'appelle sans jeton
utilisateur, l'accès est protégé par l'en-tête `x-push-secret` (comparé en temps constant).
Vérification : ouvrir `https://qfgnxonqwldcfdjqhhjz.supabase.co/functions/v1/send-push` → `{"publicKey":"B…"}`.
## 5. Adresse et secret dans Supabase Vault (SQL Editor)
Le déclencheur lit ces deux valeurs dans Vault (elles ne sont jamais écrites dans une migration) :
```sql
select vault.create_secret('https://qfgnxonqwldcfdjqhhjz.supabase.co/functions/v1/send-push', 'azuu_push_url');
select vault.create_secret('<la même valeur que PUSH_WEBHOOK_SECRET>', 'azuu_push_secret');
```
Pour changer une valeur plus tard :
```sql
select vault.update_secret((select id from vault.secrets where name = 'azuu_push_secret'), '<nouvelle valeur>');
```
(et mettre la même dans le secret `PUSH_WEBHOOK_SECRET` de la fonction).
## 6. Publier l'app
`git push` (Gitea Actions construit et publie). Le service worker se met à jour tout seul ;
il charge `push-sw.js` (servi en `Cache-Control: no-cache`, en-tête généré depuis `vite.config.ts`).
## 7. Tester
1. Sur l'app : **Réglages → Notifications → Notifications sur cet appareil** (la permission n'est demandée qu'à ce moment-là).
- iPhone / iPad : uniquement depuis l'app **installée sur l'écran d'accueil**, iOS 16.4 ou plus récent.
2. Depuis un autre compte, s'abonner à ce compte → une notification doit arriver (même app fermée).
3. En cas de souci :
```sql
select count(*) from public.push_subscriptions; -- l'appareil est-il inscrit ?
select id, status_code, content, created from net._http_response order by created desc limit 10; -- appels de la base
```
et **Edge Functions → send-push → Logs**. Un `401` = `PUSH_WEBHOOK_SECRET` et `azuu_push_secret` différents ;
un `503 not-configured` = secrets VAPID manquants ou mal copiés.
## Sécurité (résumé)
- `push_subscriptions` : RLS activé et forcé ; chacun ne voit / supprime que ses appareils ; ajout uniquement via
`register_push_subscription` (security definer) qui n'accepte que des adresses **https** vers les services push
connus (`fcm.googleapis.com`, `updates.push.services.mozilla.com`, `*.push.apple.com`, `web.push.apple.com`,
`*.notify.windows.com`) : pas de SSRF possible. La fonction d'envoi revérifie la liste.
- 10 appareils max par compte (les plus anciens sont retirés), 10 nouvelles inscriptions max par 10 minutes.
- Un abonnement déjà lié à un autre compte n'est repris que si l'on fournit les mêmes clés (même navigateur).
- À la déconnexion, l'appareil est désinscrit ; à la suppression du compte, tout part en cascade.
- `push_claim` / `push_done` : réservées au rôle `service_role`. Les préférences `notifPrefs` sont appliquées
à la création **et** à l'envoi.
- Changer les clés VAPID invalide les abonnements existants : après une rotation, vider la table
(`delete from public.push_subscriptions;`) ; chacun réactive l'interrupteur.
-2
View File
@@ -10,5 +10,3 @@ verify_jwt = false
[functions.delete-account]
verify_jwt = false
[functions.send-push]
verify_jwt = false
-201
View File
@@ -1,201 +0,0 @@
// Web Push sans dépendance : chiffrement « aes128gcm » (RFC 8188 + RFC 8291) et
// authentification VAPID (RFC 8292, jeton JWT ES256), uniquement avec WebCrypto.
// Aucune API propre à Deno ici : le module est aussi testé avec Node (vecteurs de la RFC 8291).
const enc = new TextEncoder()
/** Octets adossés à un ArrayBuffer (exigé par les types WebCrypto / fetch récents) */
export type Bytes = Uint8Array<ArrayBuffer>
export function b64urlEncode(bytes: Bytes): string {
let s = ''
for (const b of bytes) s += String.fromCharCode(b)
return btoa(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '')
}
export function b64urlDecode(str: string): Bytes {
if (!/^[A-Za-z0-9_-]*={0,2}$/.test(str)) throw new Error('base64url invalide')
const b64 = str.replace(/=+$/, '').replace(/-/g, '+').replace(/_/g, '/')
const bin = atob(b64 + '='.repeat((4 - (b64.length % 4)) % 4))
const out = new Uint8Array(bin.length)
for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i)
return out
}
function concat(...parts: Uint8Array[]): Bytes {
const out = new Uint8Array(parts.reduce((n, p) => n + p.length, 0))
let o = 0
for (const p of parts) {
out.set(p, o)
o += p.length
}
return out
}
async function hmac(key: Bytes, data: Bytes): Promise<Bytes> {
const k = await crypto.subtle.importKey('raw', key, { name: 'HMAC', hash: 'SHA-256' }, false, ['sign'])
return new Uint8Array(await crypto.subtle.sign('HMAC', k, data))
}
/** Clé publique P-256 brute (65 octets, 0x04 || X || Y) → JWK. */
function rawToJwk(raw: Bytes, d?: Bytes): JsonWebKey {
if (raw.length !== 65 || raw[0] !== 4) throw new Error('clé publique P-256 invalide')
return {
kty: 'EC',
crv: 'P-256',
x: b64urlEncode(raw.slice(1, 33)),
y: b64urlEncode(raw.slice(33, 65)),
...(d ? { d: b64urlEncode(d) } : {}),
ext: true,
}
}
export interface EncryptOptions {
/** Pour les tests uniquement : paire éphémère et sel imposés (vecteurs RFC 8291). */
asPrivate?: Bytes
asPublic?: Bytes
salt?: Bytes
/** Taille d'enregistrement annoncée (4096 par défaut) */
rs?: number
}
/**
* Chiffre un message pour un abonnement push (Content-Encoding: aes128gcm).
* @param uaPublic clé « p256dh » de l'abonnement (65 octets)
* @param authSecret clé « auth » de l'abonnement (16 octets)
*/
export async function encryptPayload(
plaintext: Bytes,
uaPublic: Bytes,
authSecret: Bytes,
opts: EncryptOptions = {},
): Promise<Bytes> {
if (uaPublic.length !== 65 || uaPublic[0] !== 4) throw new Error('p256dh invalide')
if (authSecret.length < 16) throw new Error('auth invalide')
const rs = opts.rs ?? 4096
// Un seul enregistrement : le message (+ 1 octet de délimitation + 16 octets de tag) doit tenir dedans
if (plaintext.length + 1 + 16 > rs) throw new Error('message trop long')
// Paire de clés éphémère du serveur d'application
let asPriv: CryptoKey
let asPublic: Bytes
if (opts.asPrivate && opts.asPublic) {
asPriv = await crypto.subtle.importKey('jwk', rawToJwk(opts.asPublic, opts.asPrivate), { name: 'ECDH', namedCurve: 'P-256' }, false, ['deriveBits'])
asPublic = opts.asPublic
} else {
const pair = (await crypto.subtle.generateKey({ name: 'ECDH', namedCurve: 'P-256' }, true, ['deriveBits'])) as CryptoKeyPair
asPriv = pair.privateKey
asPublic = new Uint8Array(await crypto.subtle.exportKey('raw', pair.publicKey))
}
const uaKey = await crypto.subtle.importKey('raw', uaPublic, { name: 'ECDH', namedCurve: 'P-256' }, false, [])
const ecdhSecret = new Uint8Array(await crypto.subtle.deriveBits({ name: 'ECDH', public: uaKey }, asPriv, 256))
// RFC 8291 §3.3-3.4 (HKDF écrit avec HMAC, une seule itération suffit pour ≤ 32 octets)
const prkKey = await hmac(authSecret, ecdhSecret)
const keyInfo = concat(enc.encode('WebPush: info\0'), uaPublic, asPublic)
const ikm = await hmac(prkKey, concat(keyInfo, new Uint8Array([1])))
const salt = opts.salt ?? crypto.getRandomValues(new Uint8Array(16))
if (salt.length !== 16) throw new Error('sel invalide')
const prk = await hmac(salt, ikm)
const cek = (await hmac(prk, enc.encode('Content-Encoding: aes128gcm\0\x01'))).slice(0, 16)
const nonce = (await hmac(prk, enc.encode('Content-Encoding: nonce\0\x01'))).slice(0, 12)
// Dernier (et seul) enregistrement : délimiteur 0x02, sans remplissage
const record = concat(plaintext, new Uint8Array([2]))
const aes = await crypto.subtle.importKey('raw', cek, { name: 'AES-GCM' }, false, ['encrypt'])
const cipher = new Uint8Array(await crypto.subtle.encrypt({ name: 'AES-GCM', iv: nonce, tagLength: 128 }, aes, record))
// En-tête RFC 8188 : sel (16) || rs (4, gros-boutiste) || idlen (1) || keyid (clé publique éphémère)
const header = new Uint8Array(16 + 4 + 1 + asPublic.length)
header.set(salt, 0)
new DataView(header.buffer).setUint32(16, rs, false)
header[20] = asPublic.length
header.set(asPublic, 21)
return concat(header, cipher)
}
export interface VapidKeys {
/** Clé publique brute en base64url (65 octets) */
publicKey: string
/** Clé privée (scalaire « d », 32 octets) en base64url */
privateKey: string
/** « mailto:… » ou « https://… » */
subject: string
}
const signingKeys = new Map<string, Promise<CryptoKey>>()
function vapidSigningKey(v: VapidKeys): Promise<CryptoKey> {
const cacheKey = v.publicKey
let p = signingKeys.get(cacheKey)
if (!p) {
p = crypto.subtle.importKey('jwk', rawToJwk(b64urlDecode(v.publicKey), b64urlDecode(v.privateKey)), { name: 'ECDSA', namedCurve: 'P-256' }, false, ['sign'])
signingKeys.set(cacheKey, p)
}
return p
}
/** En-tête Authorization VAPID pour un point d'envoi donné (jeton valable 12 h). */
export async function vapidAuthorization(endpoint: string, v: VapidKeys, nowSec = Math.floor(Date.now() / 1000)): Promise<string> {
const aud = new URL(endpoint).origin
const header = b64urlEncode(enc.encode(JSON.stringify({ typ: 'JWT', alg: 'ES256' })))
const claims = b64urlEncode(enc.encode(JSON.stringify({ aud, exp: nowSec + 12 * 3600, sub: v.subject })))
const unsigned = `${header}.${claims}`
// WebCrypto renvoie la signature au format r || s (64 octets), celui attendu par JWS
const sig = new Uint8Array(await crypto.subtle.sign({ name: 'ECDSA', hash: 'SHA-256' }, await vapidSigningKey(v), enc.encode(unsigned)))
return `vapid t=${unsigned}.${b64urlEncode(sig)}, k=${v.publicKey}`
}
export interface PushTarget {
endpoint: string
p256dh: string
auth: string
}
export type PushResult = 'ok' | 'gone' | 'error'
/** Envoie un message chiffré à un abonnement. « gone » = abonnement expiré (à supprimer). */
export async function sendWebPush(target: PushTarget, payload: string, v: VapidKeys, ttl = 24 * 3600, topic?: string): Promise<PushResult> {
const body = await encryptPayload(enc.encode(payload), b64urlDecode(target.p256dh), b64urlDecode(target.auth))
const headers: Record<string, string> = {
Authorization: await vapidAuthorization(target.endpoint, v),
'Content-Encoding': 'aes128gcm',
'Content-Type': 'application/octet-stream',
TTL: String(ttl),
Urgency: 'normal',
}
// « Topic » : un message plus récent du même sujet remplace celui encore en attente
if (topic && /^[A-Za-z0-9_-]{1,32}$/.test(topic)) headers.Topic = topic
const ctrl = new AbortController()
const timer = setTimeout(() => ctrl.abort(), 10_000)
try {
const res = await fetch(target.endpoint, { method: 'POST', headers, body, signal: ctrl.signal, redirect: 'error' })
await res.body?.cancel()
if (res.status === 404 || res.status === 410) return 'gone'
return res.ok ? 'ok' : 'error'
} catch {
return 'error'
} finally {
clearTimeout(timer)
}
}
/** Mêmes hôtes que la vérification côté base (anti-SSRF, double contrôle). */
export function isAllowedPushEndpoint(endpoint: string): boolean {
if (endpoint.length > 1024) return false
let u: URL
try {
u = new URL(endpoint)
} catch {
return false
}
if (u.protocol !== 'https:' || u.username || u.password || (u.port && u.port !== '443')) return false
const h = u.hostname.toLowerCase()
return (
h === 'fcm.googleapis.com' ||
h === 'updates.push.services.mozilla.com' ||
h === 'web.push.apple.com' ||
/^[a-z0-9-]{1,63}(\.[a-z0-9-]{1,63})*\.push\.apple\.com$/.test(h) ||
/^[a-z0-9-]{1,63}(\.[a-z0-9-]{1,63})*\.notify\.windows\.com$/.test(h)
)
}
-104
View File
@@ -1,104 +0,0 @@
// Transforme les notifications d'un compte en messages push courts (regroupés si besoin).
// Module sans API Deno : testé aussi avec Node.
import { fill, MESSAGES } from './messages.ts'
export interface ClaimedItem {
id: number
kind: string
emoji: string | null
item_id: string | null
episode: number | null
ep_count: number | null
actor: { username: string; display_name: string } | null
title: string | null
}
export interface PushMessage {
title: string
body: string
/** Écran à ouvrir au clic (paramètre « open » de l'app) */
open: string
/** Une notification du même « tag » remplace la précédente sur l'appareil */
tag: string
}
const EMOJIS = new Set(['👍', '❤️', '🔥', '😂', '😮', '😢'])
/** Texte venu de la base : sans caractères de contrôle ni de direction, longueur bornée. */
export function clean(v: unknown, max: number): string {
if (typeof v !== 'string') return ''
const s = v.replace(/[\u0000-\u001f\u007f-\u009f\u200b-\u200f\u202a-\u202e\u2066-\u2069]/g, '').replace(/\s+/g, ' ').trim()
return s.length > max ? s.slice(0, max - 1).trimEnd() + '…' : s
}
const SAFE_ID = /^[A-Za-z0-9_-]{1,64}$/
const SAFE_USER = /^[a-z0-9_]{3,20}$/
export function compose(items: ClaimedItem[], lang: string): PushMessage[] {
const tx = MESSAGES[lang] ?? MESSAGES.fr
const out: PushMessage[] = []
const eps = items.filter((i) => i.kind === 'new_episode' || i.kind === 'new_season')
const social = items.filter((i) => i.kind !== 'new_episode' && i.kind !== 'new_season')
// Épisodes : un message par série, ou un seul résumé s'il y en a plusieurs
if (eps.length === 1) {
const e = eps[0]
const n = Number.isInteger(e.episode) && (e.episode as number) > 0 ? (e.episode as number) : null
out.push({
title: clean(e.title, 80) || 'Kino',
body: e.kind === 'new_season' || n === null ? tx.season : fill(tx.episode, { n }),
open: e.item_id && SAFE_ID.test(e.item_id) ? `item:${e.item_id}` : 'notifications',
tag: e.item_id && SAFE_ID.test(e.item_id) ? `ep-${e.item_id}`.slice(0, 64) : 'episodes',
})
} else if (eps.length > 1) {
const titles = [...new Set(eps.map((e) => clean(e.title, 40)).filter(Boolean))]
out.push({
title: `${tx.episodesTitle} (${eps.length})`,
body: clean(titles.join(' · '), 160) || fill(tx.many, { count: eps.length }),
open: 'notifications',
tag: 'episodes',
})
}
// Abonnements / réactions : un message chacun (3 au plus), sinon un résumé
if (social.length > 3) {
out.push({ title: 'Kino', body: fill(tx.many, { count: social.length }), open: 'notifications', tag: 'social' })
} else {
for (const s of social) {
const name = clean(s.actor?.display_name, 40) || clean(s.actor?.username, 20) || 'Kino'
const user = s.actor && SAFE_USER.test(s.actor.username) ? s.actor.username : null
let body: string
let open = 'notifications'
let title = 'Kino'
switch (s.kind) {
case 'follow_request':
body = fill(tx.followRequest, { name })
break
case 'new_follower':
body = fill(tx.newFollower, { name })
if (user) open = `u:${user}`
break
case 'follow_accepted':
body = fill(tx.followAccepted, { name })
if (user) open = `u:${user}`
break
case 'reaction':
body = fill(tx.reaction, { name, emoji: s.emoji && EMOJIS.has(s.emoji) ? s.emoji : '' }).replace(/\s+/g, ' ')
title = clean(s.title, 80) || 'Kino'
break
case 'review_comment':
body = fill(tx.comment, { name })
title = clean(s.title, 80) || 'Kino'
break
case 'shared_list_invite':
body = fill(tx.listInvite, { name, list: clean(s.title, 60) })
break
default:
continue
}
out.push({ title, body, open, tag: `n-${s.id}` })
}
}
return out
}
-119
View File
@@ -1,119 +0,0 @@
// Notifications push (Web Push).
// - GET : renvoie la clé publique VAPID (pour que l'app puisse s'abonner).
// - POST : appelé par la base à chaque nouvelle notification (déclencheur + pg_net),
// avec l'en-tête « x-push-secret ». Prend les notifications non envoyées du compte,
// applique ses préférences, les regroupe et les envoie à tous ses appareils.
// Secrets (supabase secrets set …) : VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, VAPID_SUBJECT, PUSH_WEBHOOK_SECRET.
// Voir supabase/PUSH_SETUP.md.
import { corsHeaders, json } from '../_shared/auth.ts'
import { isAllowedPushEndpoint, sendWebPush, type VapidKeys } from '../_shared/webpush.ts'
import { compose, type ClaimedItem } from './compose.ts'
const SUPABASE_URL = Deno.env.get('SUPABASE_URL') ?? ''
const SERVICE_KEY = Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') ?? ''
const WEBHOOK_SECRET = Deno.env.get('PUSH_WEBHOOK_SECRET') ?? ''
const VAPID: VapidKeys = {
publicKey: (Deno.env.get('VAPID_PUBLIC_KEY') ?? '').trim(),
privateKey: (Deno.env.get('VAPID_PRIVATE_KEY') ?? '').trim(),
subject: (Deno.env.get('VAPID_SUBJECT') ?? '').trim(),
}
const vapidReady = /^B[A-Za-z0-9_-]{86}$/.test(VAPID.publicKey) && /^[A-Za-z0-9_-]{43}$/.test(VAPID.privateKey) && /^(mailto:|https:\/\/)/.test(VAPID.subject)
const enc = new TextEncoder()
/** Comparaison en temps constant (le secret ne peut pas être deviné caractère par caractère). */
async function sameSecret(given: string, expected: string): Promise<boolean> {
if (!given || expected.length < 32 || given.length > 512) return false
const key = await crypto.subtle.importKey('raw', crypto.getRandomValues(new Uint8Array(32)), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign'])
const [a, b] = await Promise.all([crypto.subtle.sign('HMAC', key, enc.encode(given)), crypto.subtle.sign('HMAC', key, enc.encode(expected))])
const x = new Uint8Array(a)
const y = new Uint8Array(b)
let diff = 0
for (let i = 0; i < x.length; i++) diff |= x[i] ^ y[i]
return diff === 0
}
async function rpc<T>(name: string, args: Record<string, unknown>): Promise<T> {
const res = await fetch(`${SUPABASE_URL}/rest/v1/rpc/${name}`, {
method: 'POST',
headers: { apikey: SERVICE_KEY, Authorization: `Bearer ${SERVICE_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify(args),
})
if (!res.ok) throw new Error(`${name}: ${res.status}`)
const text = await res.text()
return (text ? JSON.parse(text) : null) as T
}
interface Sub {
endpoint: string
p256dh: string
auth: string
lang: string
}
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
Deno.serve(async (req) => {
if (req.method === 'OPTIONS') return new Response(null, { status: 204, headers: corsHeaders(req) })
// Clé publique : elle n'a rien de secret (elle est envoyée au service push du navigateur)
if (req.method === 'GET') {
if (!vapidReady) return json(req, 503, { error: 'not-configured' })
return json(req, 200, { publicKey: VAPID.publicKey }, { 'Cache-Control': 'public, max-age=3600' })
}
if (req.method !== 'POST') return json(req, 405, { error: 'method' })
// Appel réservé à la base de données
if (!WEBHOOK_SECRET || !(await sameSecret(req.headers.get('x-push-secret') ?? '', WEBHOOK_SECRET))) {
return json(req, 401, { error: 'auth' })
}
if (!vapidReady || !SERVICE_KEY || !SUPABASE_URL) return json(req, 503, { error: 'not-configured' })
let userId = ''
try {
const body = (await req.json()) as { user_id?: unknown }
if (typeof body.user_id === 'string' && UUID.test(body.user_id)) userId = body.user_id
} catch {
/* corps invalide */
}
if (!userId) return json(req, 400, { error: 'user' })
let claim: { subs?: Sub[]; items?: ClaimedItem[] }
try {
claim = (await rpc<typeof claim>('push_claim', { p_user: userId })) ?? {}
} catch {
return json(req, 502, { error: 'claim' })
}
const subs = (claim.subs ?? []).filter((s) => isAllowedPushEndpoint(s.endpoint)).slice(0, 10)
const items = (claim.items ?? []).slice(0, 100)
if (!subs.length || !items.length) return json(req, 200, { sent: 0 })
const gone: string[] = []
const ok: string[] = []
let sent = 0
await Promise.all(
subs.map(async (s) => {
const messages = compose(items, s.lang).slice(0, 4)
let alive = true
for (const m of messages) {
if (!alive) break
const payload = JSON.stringify({ title: m.title, body: m.body, tag: m.tag, url: `/?open=${encodeURIComponent(m.open)}` })
const r = await sendWebPush(s, payload, VAPID, 24 * 3600, m.tag.replace(/[^A-Za-z0-9_-]/g, '').slice(0, 32))
if (r === 'gone') {
gone.push(s.endpoint)
alive = false
} else if (r === 'ok') {
sent++
if (!ok.includes(s.endpoint)) ok.push(s.endpoint)
}
}
}),
)
try {
await rpc('push_done', { p_user: userId, p_gone: gone, p_ok: ok })
} catch {
/* le ménage se fera au prochain envoi */
}
return json(req, 200, { sent, gone: gone.length })
})
-238
View File
@@ -1,238 +0,0 @@
// Textes courts des notifications push, dans la langue choisie sur l'appareil à l'inscription.
// Variables : {name} (auteur), {emoji}, {n} (numéro d'épisode), {count}, {list} (nom de liste).
export interface PushTexts {
followRequest: string
newFollower: string
followAccepted: string
reaction: string
episode: string
season: string
episodesTitle: string
many: string
comment: string
listInvite: string
}
export const MESSAGES: Record<string, PushTexts> = {
fr: {
followRequest: '{name} veut s’abonner à toi',
newFollower: '{name} te suit désormais',
followAccepted: '{name} a accepté ta demande d’abonnement',
reaction: '{name} a réagi {emoji} à ton avis',
episode: 'Épisode {n} disponible',
season: 'Nouvelle saison disponible',
episodesTitle: 'Nouveaux épisodes',
many: 'Nouvelles notifications : {count}',
comment: '{name} a commenté ton avis',
listInvite: "{name} t'invite dans la liste « {list} »",
},
en: {
followRequest: '{name} wants to follow you',
newFollower: '{name} is now following you',
followAccepted: '{name} accepted your follow request',
reaction: '{name} reacted {emoji} to your review',
episode: 'Episode {n} is out',
season: 'New season is out',
episodesTitle: 'New episodes',
many: 'New notifications: {count}',
comment: '{name} commented on your review',
listInvite: '{name} invited you to the list “{list}”',
},
es: {
followRequest: '{name} quiere seguirte',
newFollower: '{name} ahora te sigue',
followAccepted: '{name} aceptó tu solicitud de seguimiento',
reaction: '{name} reaccionó {emoji} a tu reseña',
episode: 'Episodio {n} disponible',
season: 'Nueva temporada disponible',
episodesTitle: 'Nuevos episodios',
many: 'Notificaciones nuevas: {count}',
comment: '{name} comentó tu reseña',
listInvite: '{name} te invitó a la lista «{list}»',
},
it: {
followRequest: '{name} vuole seguirti',
newFollower: '{name} ora ti segue',
followAccepted: '{name} ha accettato la tua richiesta',
reaction: '{name} ha reagito {emoji} alla tua recensione',
episode: 'Episodio {n} disponibile',
season: 'Nuova stagione disponibile',
episodesTitle: 'Nuovi episodi',
many: 'Nuove notifiche: {count}',
comment: '{name} ha commentato la tua recensione',
listInvite: '{name} ti ha invitato nella lista «{list}»',
},
de: {
followRequest: '{name} möchte dir folgen',
newFollower: '{name} folgt dir jetzt',
followAccepted: '{name} hat deine Anfrage angenommen',
reaction: '{name} hat mit {emoji} auf deine Bewertung reagiert',
episode: 'Folge {n} ist verfügbar',
season: 'Neue Staffel verfügbar',
episodesTitle: 'Neue Folgen',
many: 'Neue Benachrichtigungen: {count}',
comment: '{name} hat deine Bewertung kommentiert',
listInvite: '{name} hat dich zur Liste „{list}“ eingeladen',
},
pt: {
followRequest: '{name} quer seguir você',
newFollower: '{name} agora segue você',
followAccepted: '{name} aceitou seu pedido para seguir',
reaction: '{name} reagiu {emoji} à sua avaliação',
episode: 'Episódio {n} disponível',
season: 'Nova temporada disponível',
episodesTitle: 'Novos episódios',
many: 'Novas notificações: {count}',
comment: '{name} comentou sua avaliação',
listInvite: '{name} convidou você para a lista “{list}”',
},
nl: {
followRequest: '{name} wil je volgen',
newFollower: '{name} volgt je nu',
followAccepted: '{name} heeft je volgverzoek geaccepteerd',
reaction: '{name} reageerde {emoji} op je recensie',
episode: 'Aflevering {n} is uit',
season: 'Nieuw seizoen beschikbaar',
episodesTitle: 'Nieuwe afleveringen',
many: 'Nieuwe meldingen: {count}',
comment: '{name} reageerde op je recensie',
listInvite: '{name} nodigde je uit voor de lijst ‘{list}’',
},
pl: {
followRequest: '{name} chce cię obserwować',
newFollower: '{name} obserwuje cię',
followAccepted: '{name} zaakceptował(a) twoją prośbę',
reaction: '{name} zareagował(a) {emoji} na twoją recenzję',
episode: 'Odcinek {n} jest dostępny',
season: 'Nowy sezon jest dostępny',
episodesTitle: 'Nowe odcinki',
many: 'Nowe powiadomienia: {count}',
comment: '{name} skomentował(a) twoją recenzję',
listInvite: '{name} zaprasza cię do listy „{list}”',
},
ru: {
followRequest: '{name} хочет подписаться на вас',
newFollower: '{name} теперь подписан(а) на вас',
followAccepted: '{name} принял(а) ваш запрос на подписку',
reaction: '{name} отреагировал(а) {emoji} на ваш отзыв',
episode: 'Вышла серия {n}',
season: 'Вышел новый сезон',
episodesTitle: 'Новые серии',
many: 'Новые уведомления: {count}',
comment: '{name} прокомментировал(а) ваш отзыв',
listInvite: '{name} приглашает вас в список «{list}»',
},
tr: {
followRequest: '{name} seni takip etmek istiyor',
newFollower: '{name} artık seni takip ediyor',
followAccepted: '{name} takip isteğini kabul etti',
reaction: '{name} incelemene {emoji} tepkisi verdi',
episode: '{n}. bölüm yayında',
season: 'Yeni sezon yayında',
episodesTitle: 'Yeni bölümler',
many: 'Yeni bildirimler: {count}',
comment: '{name} incelemene yorum yaptı',
listInvite: '{name} seni “{list}” listesine davet etti',
},
ar: {
followRequest: '{name} يريد متابعتك',
newFollower: '{name} يتابعك الآن',
followAccepted: '{name} قبل طلب المتابعة',
reaction: '{name} تفاعل {emoji} مع مراجعتك',
episode: 'الحلقة {n} متاحة',
season: 'موسم جديد متاح',
episodesTitle: 'حلقات جديدة',
many: 'إشعارات جديدة: {count}',
comment: '{name} علّق على مراجعتك',
listInvite: '{name} يدعوك إلى القائمة «{list}»',
},
hi: {
followRequest: '{name} आपको फ़ॉलो करना चाहते हैं',
newFollower: '{name} अब आपको फ़ॉलो करते हैं',
followAccepted: '{name} ने आपका फ़ॉलो अनुरोध स्वीकार किया',
reaction: '{name} ने आपकी समीक्षा पर {emoji} प्रतिक्रिया दी',
episode: 'एपिसोड {n} उपलब्ध है',
season: 'नया सीज़न उपलब्ध है',
episodesTitle: 'नए एपिसोड',
many: 'नई सूचनाएँ: {count}',
comment: '{name} ने आपकी समीक्षा पर टिप्पणी की',
listInvite: '{name} ने आपको सूची “{list}” में आमंत्रित किया',
},
id: {
followRequest: '{name} ingin mengikutimu',
newFollower: '{name} sekarang mengikutimu',
followAccepted: '{name} menerima permintaan mengikutimu',
reaction: '{name} bereaksi {emoji} pada ulasanmu',
episode: 'Episode {n} sudah tersedia',
season: 'Musim baru sudah tersedia',
episodesTitle: 'Episode baru',
many: 'Notifikasi baru: {count}',
comment: '{name} mengomentari ulasanmu',
listInvite: '{name} mengundangmu ke daftar “{list}”',
},
th: {
followRequest: '{name} ต้องการติดตามคุณ',
newFollower: '{name} ติดตามคุณแล้ว',
followAccepted: '{name} ยอมรับคำขอติดตามของคุณแล้ว',
reaction: '{name} แสดงความรู้สึก {emoji} ต่อรีวิวของคุณ',
episode: 'ตอนที่ {n} มาแล้ว',
season: 'ซีซันใหม่มาแล้ว',
episodesTitle: 'ตอนใหม่',
many: 'การแจ้งเตือนใหม่: {count}',
comment: '{name} แสดงความคิดเห็นในรีวิวของคุณ',
listInvite: '{name} เชิญคุณเข้าร่วมรายการ “{list}”',
},
vi: {
followRequest: '{name} muốn theo dõi bạn',
newFollower: '{name} đã theo dõi bạn',
followAccepted: '{name} đã chấp nhận yêu cầu theo dõi',
reaction: '{name} đã bày tỏ {emoji} với đánh giá của bạn',
episode: 'Tập {n} đã ra mắt',
season: 'Mùa mới đã ra mắt',
episodesTitle: 'Tập mới',
many: 'Thông báo mới: {count}',
comment: '{name} đã bình luận về đánh giá của bạn',
listInvite: '{name} mời bạn vào danh sách “{list}”',
},
zh: {
followRequest: '{name} 想要关注你',
newFollower: '{name} 关注了你',
followAccepted: '{name} 接受了你的关注请求',
reaction: '{name} 对你的评论回应了 {emoji}',
episode: '第 {n} 集已上线',
season: '新一季已上线',
episodesTitle: '新剧集',
many: '新通知:{count}',
comment: '{name} 评论了你的影评',
listInvite: '{name} 邀请你加入列表「{list}」',
},
ja: {
followRequest: '{name}さんがあなたをフォローしたいと言っています',
newFollower: '{name}さんがあなたをフォローしました',
followAccepted: '{name}さんがフォローリクエストを承認しました',
reaction: '{name}さんがあなたのレビューに{emoji}でリアクションしました',
episode: '第{n}話が配信されました',
season: '新シーズンが配信されました',
episodesTitle: '新しいエピソード',
many: '新しい通知:{count}',
comment: '{name}さんがあなたのレビューにコメントしました',
listInvite: '{name}さんがリスト「{list}」にあなたを招待しました',
},
ko: {
followRequest: '{name}님이 팔로우를 요청했어요',
newFollower: '{name}님이 회원님을 팔로우해요',
followAccepted: '{name}님이 팔로우 요청을 수락했어요',
reaction: '{name}님이 리뷰에 {emoji} 반응을 남겼어요',
episode: '{n}화가 공개됐어요',
season: '새 시즌이 공개됐어요',
episodesTitle: '새 에피소드',
many: '새 알림: {count}',
comment: '{name}님이 리뷰에 댓글을 남겼어요',
listInvite: "{name}님이 '{list}' 리스트에 초대했어요",
},
}
export function fill(text: string, vars: Record<string, string | number>): string {
return text.replace(/\{(\w+)\}/g, (m, k: string) => (k in vars ? String(vars[k]) : m))
}
@@ -0,0 +1,29 @@
-- Kino — suppression du système de notifications (22 novembre 2026). Idempotent.
-- Plus aucune notification n'est créée ni envoyée (cloche et push). Les tables restent en place,
-- vides, car d'autres fonctions y font encore référence (listes partagées…).
-- Envoi push à chaque notification, et notifications automatiques (abonnements, réactions)
drop trigger if exists notifications_push on public.notifications;
drop trigger if exists follows_notify on public.follows;
drop trigger if exists reactions_notify on public.review_reactions;
-- Commentaires, invitations… appelaient azuu_notify : elle ne fait plus rien
create or replace function public.azuu_notify(p_user uuid, p_kind text, p_actor uuid, p_item text default null, p_emoji text default null)
returns void language plpgsql security definer set search_path = '' as $$
begin
return;
end $$;
-- Nouveaux épisodes : plus de notification
create or replace function public.add_episode_notifications(p_list jsonb)
returns integer language plpgsql security definer set search_path = '' as $$
begin
return 0;
end $$;
-- Plus aucun appareil ne peut s'inscrire aux notifications push
revoke execute on function public.register_push_subscription(text, text, text, text, text) from public, anon, authenticated;
-- Données devenues inutiles : appareils inscrits et notifications déjà reçues
delete from public.push_subscriptions;
delete from public.notifications;
-7
View File
@@ -3,10 +3,6 @@ import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { VitePWA } from 'vite-plugin-pwa'
// Gestion des notifications push (public/push-sw.js), ajoutée au service worker généré.
// La date de build dans l'adresse fait changer sw.js à chaque version : push-sw.js est toujours rechargé.
const pushSwVersion = Date.now().toString(36)
/**
* Politique de sécurité du contenu (CSP) : le navigateur n'exécute que les scripts de l'app,
* et ne contacte que TMDB / AniList. Même si une donnée piégée arrivait à s'afficher,
@@ -59,8 +55,6 @@ function contentSecurityPolicy(supabaseUrl: string): Plugin {
'# Le service worker doit toujours être revérifié pour que les mises à jour arrivent',
'/sw.js',
' Cache-Control: no-cache',
'/push-sw.js',
' Cache-Control: no-cache',
'',
].join('\n'),
})
@@ -113,7 +107,6 @@ export default defineConfig(({ mode }) => {
],
},
workbox: {
importScripts: [`push-sw.js?v=${pushSwVersion}`],
globPatterns: ['**/*.{js,css,html,svg,png,ico,webmanifest,woff2}'],
// L'app vit entièrement sur « / » (routes après le #) : toute autre adresse reçoit la page 404 du serveur
navigateFallbackAllowlist: [/^\/(?:index\.html)?(?:\?.*)?$/],