mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
* llm instructions * vibe dailyco * vibe dailyco * doc update (vibe) * dont show recording ui on call * stub processor (vibe) * stub processor (vibe) self-review * stub processor (vibe) self-review * chore(main): release 0.14.0 (#670) * Add multitrack pipeline * Mixdown audio tracks * Mixdown with pyav filter graph * Trigger multitrack processing for daily recordings * apply platform from envs in priority: non-dry * Use explicit track keys for processing * Align tracks of a multitrack recording * Generate waveforms for the mixed audio * Emit multriack pipeline events * Fix multitrack pipeline track alignment * dailico docs * Enable multitrack reprocessing * modal temp files uniform names, cleanup. remove llm temporary docs * docs cleanup * dont proceed with raw recordings if any of the downloads fail * dry transcription pipelines * remove is_miltitrack * comments * explicit dailyco room name * docs * remove stub data/method * frontend daily/whereby code self-review (no-mistake) * frontend daily/whereby code self-review (no-mistakes) * frontend daily/whereby code self-review (no-mistakes) * consent cleanup for multitrack (no-mistakes) * llm fun * remove extra comments * fix tests * merge migrations * Store participant names * Get participants by meeting session id * pop back main branch migration * s3 paddington (no-mistakes) * comment * pr comments * pr comments * pr comments * platform / meeting cleanup * Use participant names in summary generation * platform assignment to meeting at controller level * pr comment * room playform properly default none * room playform properly default none * restore migration lost * streaming WIP * extract storage / use common storage / proper env vars for storage * fix mocks tests * remove fall back * streaming for multifile * cenrtal storage abstraction (no-mistakes) * remove dead code / vars * Set participant user id for authenticated users * whereby recording name parsing fix * whereby recording name parsing fix * more file stream * storage dry + tests * remove homemade boto3 streaming and use proper boto * update migration guide * webhook creation script - print uuid --------- Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com> Co-authored-by: Mathieu Virbel <mat@meltingrocks.com> Co-authored-by: Sergey Mankovsky <sergey@monadical.com>
113 lines
3.4 KiB
Python
113 lines
3.4 KiB
Python
import uuid
|
|
from datetime import datetime
|
|
from typing import Any, Dict, Literal, Optional
|
|
|
|
from reflector.db.rooms import Room
|
|
from reflector.video_platforms.base import (
|
|
ROOM_PREFIX_SEPARATOR,
|
|
MeetingData,
|
|
VideoPlatformClient,
|
|
VideoPlatformConfig,
|
|
)
|
|
|
|
MockPlatform = Literal["mock"]
|
|
|
|
|
|
class MockPlatformClient(VideoPlatformClient):
|
|
PLATFORM_NAME: MockPlatform = "mock"
|
|
|
|
def __init__(self, config: VideoPlatformConfig):
|
|
super().__init__(config)
|
|
self._rooms: Dict[str, Dict[str, Any]] = {}
|
|
self._webhook_calls: list[Dict[str, Any]] = []
|
|
|
|
async def create_meeting(
|
|
self, room_name_prefix: str, end_date: datetime, room: Room
|
|
) -> MeetingData:
|
|
meeting_id = str(uuid.uuid4())
|
|
room_name = f"{room_name_prefix}{ROOM_PREFIX_SEPARATOR}{meeting_id[:8]}"
|
|
room_url = f"https://mock.video/{room_name}"
|
|
host_room_url = f"{room_url}?host=true"
|
|
|
|
self._rooms[room_name] = {
|
|
"id": meeting_id,
|
|
"name": room_name,
|
|
"url": room_url,
|
|
"host_url": host_room_url,
|
|
"end_date": end_date,
|
|
"room": room,
|
|
"participants": [],
|
|
"is_active": True,
|
|
}
|
|
|
|
return MeetingData.model_construct(
|
|
meeting_id=meeting_id,
|
|
room_name=room_name,
|
|
room_url=room_url,
|
|
host_room_url=host_room_url,
|
|
platform="whereby",
|
|
extra_data={"mock": True},
|
|
)
|
|
|
|
async def get_room_sessions(self, room_name: str) -> Dict[str, Any]:
|
|
if room_name not in self._rooms:
|
|
return {"error": "Room not found"}
|
|
|
|
room_data = self._rooms[room_name]
|
|
return {
|
|
"roomName": room_name,
|
|
"sessions": [
|
|
{
|
|
"sessionId": room_data["id"],
|
|
"startTime": datetime.utcnow().isoformat(),
|
|
"participants": room_data["participants"],
|
|
"isActive": room_data["is_active"],
|
|
}
|
|
],
|
|
}
|
|
|
|
async def delete_room(self, room_name: str) -> bool:
|
|
if room_name in self._rooms:
|
|
self._rooms[room_name]["is_active"] = False
|
|
return True
|
|
return False
|
|
|
|
async def upload_logo(self, room_name: str, logo_path: str) -> bool:
|
|
if room_name in self._rooms:
|
|
self._rooms[room_name]["logo_path"] = logo_path
|
|
return True
|
|
return False
|
|
|
|
def verify_webhook_signature(
|
|
self, body: bytes, signature: str, timestamp: Optional[str] = None
|
|
) -> bool:
|
|
return signature == "valid"
|
|
|
|
def add_participant(
|
|
self, room_name: str, participant_id: str, participant_name: str
|
|
):
|
|
if room_name in self._rooms:
|
|
self._rooms[room_name]["participants"].append(
|
|
{
|
|
"id": participant_id,
|
|
"name": participant_name,
|
|
"joined_at": datetime.utcnow().isoformat(),
|
|
}
|
|
)
|
|
|
|
def trigger_webhook(self, event_type: str, data: Dict[str, Any]):
|
|
self._webhook_calls.append(
|
|
{
|
|
"type": event_type,
|
|
"data": data,
|
|
"timestamp": datetime.utcnow().isoformat(),
|
|
}
|
|
)
|
|
|
|
def get_webhook_calls(self) -> list[Dict[str, Any]]:
|
|
return self._webhook_calls.copy()
|
|
|
|
def clear_data(self):
|
|
self._rooms.clear()
|
|
self._webhook_calls.clear()
|