fix(backend): create recording placeholders for legacy streams
This commit is contained in:
@@ -51,6 +51,8 @@ const listSchema = z.object({
|
||||
limit: z.coerce.number().int().min(1).max(100).default(25),
|
||||
});
|
||||
|
||||
const shouldCreateRecordingPlaceholder = (): boolean => mediaMode === 'legacy' || streamRecordingEnabled;
|
||||
|
||||
router.get('/me/list', requireDeviceAuth, async (req, res) => {
|
||||
const parsed = listSchema.safeParse(req.query);
|
||||
|
||||
@@ -339,6 +341,10 @@ router.post('/:streamSessionId/accept', requireDeviceAuth, async (req, res) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (shouldCreateRecordingPlaceholder()) {
|
||||
await createRecordingForStream(updated.id);
|
||||
}
|
||||
|
||||
if (sfuService) {
|
||||
try {
|
||||
await sfuService.startSession({
|
||||
@@ -698,7 +704,7 @@ router.post('/:streamSessionId/end', requireDeviceAuth, async (req, res) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (streamRecordingEnabled) {
|
||||
if (shouldCreateRecordingPlaceholder()) {
|
||||
await createRecordingForStream(session.id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user