增加了自动总结

main
mula.liu 2025-11-24 23:10:26 +08:00
parent 4df2f40e9c
commit ed628738d2
5 changed files with 44 additions and 3 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
dist.zip

Binary file not shown.

View File

@ -125,6 +125,7 @@ const CreateMeeting = ({ user }) => {
const formDataUpload = new FormData();
formDataUpload.append('audio_file', audioFile);
formDataUpload.append('meeting_id', meetingId);
formDataUpload.append('auto_summarize', 'false');
await apiClient.post(buildApiUrl(API_ENDPOINTS.MEETINGS.UPLOAD_AUDIO), formDataUpload, {
headers: {

View File

@ -80,7 +80,6 @@
display: grid;
grid-template-columns: 300px 280px 1fr;
gap: 2rem;
margin-bottom: 2rem;
}
/* 左侧列:用户卡片和知识库入口垂直排列 */

View File

@ -124,8 +124,23 @@ const MeetingDetails = ({ user }) => {
clearInterval(summaryPollInterval);
setSummaryPollInterval(null);
}
//
if (audioRef.current) {
audioRef.current.pause();
audioRef.current.currentTime = 0;
}
};
}, [meeting_id]);
// audioUrl
useEffect(() => {
// audioUrlaudio
if (audioRef.current) {
audioRef.current.pause();
audioRef.current.currentTime = 0;
audioRef.current.load(); // audio
}
}, [audioUrl]);
// Cleanup interval when status changes
useEffect(() => {
@ -262,13 +277,37 @@ const MeetingDetails = ({ user }) => {
// Fetch audio file if available
try {
const audioResponse = await apiClient.get(`${baseUrl}${audioEndpoint}`);
// Construct URL using uploads path and relative path from database
setAudioUrl(`${baseUrl}${audioResponse.data.file_path}`);
// Use streaming API endpoint for Safari compatibility (supports HTTP Range requests)
setAudioUrl(`${baseUrl}/api/meetings/${meeting_id}/audio/stream`);
setAudioFileName(audioResponse.data.file_name);
//
setIsPlaying(false);
setCurrentTime(0);
setDuration(0);
setAudioLoading(true);
setAudioCanPlay(false);
setAudioBuffering(false);
setAudioError(null);
setCurrentSubtitle('');
setCurrentSpeaker('');
setCurrentHighlightIndex(-1);
} catch (audioError) {
console.warn('No audio file available:', audioError);
setAudioUrl(null);
setAudioFileName(null);
//
setIsPlaying(false);
setCurrentTime(0);
setDuration(0);
setAudioLoading(false);
setAudioCanPlay(false);
setAudioBuffering(false);
setAudioError(null);
setCurrentSubtitle('');
setCurrentSpeaker('');
setCurrentHighlightIndex(-1);
}
// Fetch transcript segments from database
@ -397,6 +436,7 @@ const MeetingDetails = ({ user }) => {
formDataUpload.append('audio_file', audioFile);
formDataUpload.append('meeting_id', meeting_id);
formDataUpload.append('force_replace', 'true');
formDataUpload.append('auto_summarize', 'false');
const response = await apiClient.post(buildApiUrl(API_ENDPOINTS.MEETINGS.UPLOAD_AUDIO), formDataUpload, {
headers: {
@ -1226,6 +1266,7 @@ const MeetingDetails = ({ user }) => {
</div>
)}
<audio
key={audioUrl || 'no-audio'} // 使audioUrlkeyaudio
ref={audioRef}
onTimeUpdate={handleTimeUpdate}
onLoadedMetadata={handleLoadedMetadata}