server: allow reassign speaker range using participant_id

This commit is contained in:
2023-12-12 10:57:21 +01:00
parent d790308ec7
commit 37b11fdcb8
4 changed files with 281 additions and 9 deletions

View File

@@ -248,6 +248,23 @@ class Transcript(BaseModel):
url += f"?token={token}"
return url
def find_empty_speaker(self) -> int:
"""
Find an empty speaker seat
"""
speakers = set(
word.speaker
for topic in self.topics
for word in topic.words
if word.speaker is not None
)
i = 0
while True:
if i not in speakers:
return i
i += 1
raise Exception("No empty speaker found")
class TranscriptController:
async def get_all(