增加了自动总结

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(); const formDataUpload = new FormData();
formDataUpload.append('audio_file', audioFile); formDataUpload.append('audio_file', audioFile);
formDataUpload.append('meeting_id', meetingId); formDataUpload.append('meeting_id', meetingId);
formDataUpload.append('auto_summarize', 'false');
await apiClient.post(buildApiUrl(API_ENDPOINTS.MEETINGS.UPLOAD_AUDIO), formDataUpload, { await apiClient.post(buildApiUrl(API_ENDPOINTS.MEETINGS.UPLOAD_AUDIO), formDataUpload, {
headers: { headers: {

View File

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

View File

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