import { prisma } from "@streamclipper/db"; import { updateYtdlpCookies, updateSystemSettings, updateNotificationPrefs } from "../actions"; export const dynamic = "force-dynamic"; const STALE_COOKIE_HOURS = 4; export default async function SettingsPage() { const [setting, pollSetting, ttlSetting, notifyStart, notifyRender] = await Promise.all([ prisma.appSetting.findUnique({ where: { key: "ytdlp_cookies" } }), prisma.appSetting.findUnique({ where: { key: "poll_interval_ms" } }), prisma.appSetting.findUnique({ where: { key: "raw_segment_ttl_hours" } }), prisma.appSetting.findUnique({ where: { key: "notify_stream_start" } }), prisma.appSetting.findUnique({ where: { key: "notify_render_done" } }), ]); const cookieAgeHours = setting ? (Date.now() - setting.updatedAt.getTime()) / 3_600_000 : null; const cookieStale = cookieAgeHours !== null && cookieAgeHours > STALE_COOKIE_HOURS; const pollIntervalSec = pollSetting ? Math.round(Number(pollSetting.value) / 1000) : 60; const ttlHours = ttlSetting ? Number(ttlSetting.value) : 24; const notifyStreamStart = notifyStart?.value !== "false"; const notifyRenderDone = notifyRender?.value !== "false"; return ( <>
⚠️ {Math.round(cookieAgeHours!)} saattir güncellenmedi — büyük/popüler kanallarda bot-check hatası görülebilir, taze bir cookies.txt ile güncelle
)}YouTube canlı yayın kontrolü ve kayıt için kullanılıyor. Google, oturum çerezlerinin bir kısmını birkaç saatte bir yeniliyor — burada eskidiğini fark edersen (kanal detay sayfasında "son poll hatası" olarak görürsün) taze bir cookies.txt ile güncelle. Ana hesabın yerine ayrı, önemsiz bir Google hesabı kullanman önerilir.
Bir sonraki döngüden itibaren geçerli olur, redeploy gerekmez.