diff --git a/backend/app/api/endpoints/meetings.py b/backend/app/api/endpoints/meetings.py index 7e5405d..623707f 100644 --- a/backend/app/api/endpoints/meetings.py +++ b/backend/app/api/endpoints/meetings.py @@ -1175,6 +1175,16 @@ def get_meeting_preview_data(meeting_id: int, password: Optional[str] = None): cursor.execute(attendees_query, (meeting_id,)) attendees_data = cursor.fetchall() attendees = [{'user_id': row['user_id'], 'caption': row['caption']} for row in attendees_data] + cursor.execute( + ''' + SELECT COUNT(DISTINCT speaker_id) AS participant_count + FROM transcript_segments + WHERE meeting_id = %s AND speaker_id IS NOT NULL + ''', + (meeting_id,) + ) + speaker_count_row = cursor.fetchone() or {} + participant_count = speaker_count_row.get('participant_count') or len(attendees) tags = _process_tags(cursor, meeting.get('tags')) # 组装返回数据 @@ -1187,7 +1197,7 @@ def get_meeting_preview_data(meeting_id: int, password: Optional[str] = None): "prompt_id": meeting['prompt_id'], "prompt_name": meeting['prompt_name'], "attendees": attendees, - "attendees_count": len(attendees), + "attendees_count": participant_count, "tags": tags, "has_password": bool(meeting.get('access_password')), "processing_status": progress_info # 附带进度信息供调试