only recordings that are *recorded* require consent

This commit is contained in:
Igor Loskutov
2025-06-19 10:54:27 -04:00
parent 6cb46dc64f
commit 92a08653aa
4 changed files with 19 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
from datetime import datetime, timedelta
from typing import Annotated, Optional
from typing import Annotated, Optional, Literal
import reflector.auth as auth
from fastapi import APIRouter, Depends, HTTPException
@@ -37,6 +37,7 @@ class Meeting(BaseModel):
host_room_url: str
start_date: datetime
end_date: datetime
recording_type: Literal["none", "local", "cloud"] = "cloud"
class CreateRoom(BaseModel):

View File

@@ -9,6 +9,7 @@ import { notFound } from "next/navigation";
import useSessionStatus from "../lib/useSessionStatus";
import { useRecordingConsent } from "../recordingConsentContext";
import useApi from "../lib/useApi";
import { Meeting } from '../api';
export type RoomDetails = {
params: {
@@ -96,6 +97,10 @@ function ConsentDialog({ meetingId }: { meetingId: string }) {
return <></>
}
const recordingTypeRequiresConsent = (recordingType: NonNullable<Meeting['recording_type']>) => {
return recordingType === 'cloud';
}
export default function Room(details: RoomDetails) {
const wherebyRef = useRef<HTMLElement>(null);
const roomName = details.params.roomName;
@@ -109,6 +114,8 @@ export default function Room(details: RoomDetails) {
const meetingId = meeting?.response?.id;
const recordingType = meeting?.response?.recording_type;
const handleLeave = useCallback(() => {
router.push("/browse");
}, [router]);
@@ -165,7 +172,7 @@ export default function Room(details: RoomDetails) {
room={roomUrl}
style={{ width: "100vw", height: "100vh" }}
/>
<ConsentDialog meetingId={meetingId} />
{recordingType && recordingTypeRequiresConsent(recordingType) && <ConsentDialog meetingId={meetingId} />}
</>
)}
</>

View File

@@ -546,6 +546,12 @@ export const $Meeting = {
format: "date-time",
title: "End Date",
},
recording_type: {
type: "string",
enum: ["none", "local", "cloud"],
title: "Recording Type",
default: "cloud",
},
},
type: "object",
required: [

View File

@@ -108,8 +108,11 @@ export type Meeting = {
host_room_url: string;
start_date: string;
end_date: string;
recording_type?: "none" | "local" | "cloud";
};
export type recording_type = "none" | "local" | "cloud";
export type MeetingConsentRequest = {
consent_given: boolean;
};