feat: kanal başına segment süresini panelden ayarlama

Channel.segmentTimeSec (nullable, null = global SEGMENT_TIME_SEC env
var'ı kullan) eklendi. Kanal detay sayfasından dakika cinsinden
girilebiliyor, StreamIngestJob'a taşınıp streamIngest.ts'te ffmpeg'in
-segment_time argümanına yansıyor. Sadece o kanal için bundan sonra
başlayacak yeni kayıt oturumlarını etkiler — halihazırda çalışan bir
ffmpeg process'inin segment süresi zaten sabitlenmiş durumda.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-02 15:14:09 +03:00
co-authored by Claude Sonnet 5
parent ee79dce340
commit 3e01116729
7 changed files with 55 additions and 4 deletions
+9
View File
@@ -80,6 +80,15 @@ export async function toggleChannelActive(channelId: string, nextActive: boolean
revalidatePath("/", "layout");
}
export async function updateChannelSegmentTime(channelId: string, formData: FormData) {
const raw = String(formData.get("segmentTimeMin") ?? "").trim();
const minutes = raw === "" ? null : Number(raw);
const seconds = minutes !== null && Number.isFinite(minutes) && minutes > 0 ? Math.round(minutes * 60) : null;
await prisma.channel.update({ where: { id: channelId }, data: { segmentTimeSec: seconds } });
revalidatePath(`/channels/${channelId}`);
}
export async function toggleAllChannels(nextActive: boolean) {
await prisma.channel.updateMany({ data: { isActive: nextActive } });
revalidatePath("/", "layout");