diff --git a/server/reflector/db/transcripts.py b/server/reflector/db/transcripts.py index 423f8af6..78e34a1c 100644 --- a/server/reflector/db/transcripts.py +++ b/server/reflector/db/transcripts.py @@ -157,14 +157,17 @@ class Transcript(BaseModel): self.topics.append(topic) def upsert_participant(self, participant: TranscriptParticipant): - index = next( - (i for i, p in enumerate(self.participants) if p.id == participant.id), - None, - ) - if index is not None: - self.participants[index] = participant + if self.participants: + index = next( + (i for i, p in enumerate(self.participants) if p.id == participant.id), + None, + ) + if index is not None: + self.participants[index] = participant + else: + self.participants.append(participant) else: - self.participants.append(participant) + self.participants = [participant] return participant def delete_participant(self, participant_id: str): diff --git a/server/reflector/views/transcripts.py b/server/reflector/views/transcripts.py index 171e04d7..bfc822b1 100644 --- a/server/reflector/views/transcripts.py +++ b/server/reflector/views/transcripts.py @@ -233,7 +233,9 @@ async def transcript_update( user: Annotated[Optional[auth.UserInfo], Depends(auth.current_user_optional)], ): user_id = user["sub"] if user else None - transcript = await transcripts_controller.get_by_id(transcript_id, user_id=user_id) + transcript = await transcripts_controller.get_by_id_for_http( + transcript_id, user_id=user_id + ) if not transcript: raise HTTPException(status_code=404, detail="Transcript not found") values = info.dict(exclude_unset=True) diff --git a/server/reflector/views/transcripts_participants.py b/server/reflector/views/transcripts_participants.py index fd08405c..d62d1dbf 100644 --- a/server/reflector/views/transcripts_participants.py +++ b/server/reflector/views/transcripts_participants.py @@ -41,6 +41,9 @@ async def transcript_get_participants( transcript_id, user_id=user_id ) + if transcript.participants is None: + return [] + return [ Participant.model_validate(participant) for participant in transcript.participants @@ -59,7 +62,7 @@ async def transcript_add_participant( ) # ensure the speaker is unique - if participant.speaker is not None: + if participant.speaker is not None and transcript.participants is not None: for p in transcript.participants: if p.speaker == participant.speaker: raise HTTPException( diff --git a/www/app/[domain]/browse/page.tsx b/www/app/[domain]/browse/page.tsx index 46a81295..0a180143 100644 --- a/www/app/[domain]/browse/page.tsx +++ b/www/app/[domain]/browse/page.tsx @@ -14,13 +14,7 @@ export default function TranscriptBrowser() { const { loading, response } = useTranscriptList(page); return ( -
- Capture the signal, not the noise -
-+ Capture the signal, not the noise +
+Loading Transcript
- ) : ( -- There was an error generating the final summary, please - come back later -
- )} -Loading Transcript
+ ) : ( ++ There was an error generating the final summary, please come + back later +
+ )} +