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:
@@ -85,7 +85,7 @@ async function findLiveVideoId(channelId: string): Promise<string | null> {
|
||||
* force-start on a channel that's already live).
|
||||
*/
|
||||
export async function startCaptureSession(
|
||||
channel: { id: string; name: string },
|
||||
channel: { id: string; name: string; segmentTimeSec?: number | null },
|
||||
youtubeUrl: string,
|
||||
liveVideoId: string | null = null,
|
||||
): Promise<{ started: boolean }> {
|
||||
@@ -102,6 +102,7 @@ export async function startCaptureSession(
|
||||
sessionId: session.id,
|
||||
channelDbId: channel.id,
|
||||
youtubeUrl,
|
||||
segmentTimeSec: channel.segmentTimeSec ?? undefined,
|
||||
});
|
||||
|
||||
const notifySetting = await prisma.appSetting.findUnique({ where: { key: "notify_stream_start" } });
|
||||
@@ -113,7 +114,12 @@ export async function startCaptureSession(
|
||||
}
|
||||
|
||||
/** Runs the live-check for a single channel and applies its result — the unit both `pollOnce` and the panel's manual "şimdi kontrol et" action reuse. */
|
||||
export async function checkChannel(channel: { id: string; name: string; channelId: string }): Promise<{
|
||||
export async function checkChannel(channel: {
|
||||
id: string;
|
||||
name: string;
|
||||
channelId: string;
|
||||
segmentTimeSec?: number | null;
|
||||
}): Promise<{
|
||||
liveVideoId: string | null;
|
||||
error: PollError | null;
|
||||
}> {
|
||||
|
||||
Reference in New Issue
Block a user