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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user