feat: add voice recordings feature with database integration

- Implemented PostgreSQL and SQLite schemas for voice recordings.
- Created repository functions for inserting, updating, and listing voice recordings.
- Developed uploader logic to handle file uploads and database updates.
- Added routes for accessing voice recordings via API.
- Enhanced UI state to include recordings tab.
- Introduced moderation WebSocket event for uploaded recordings.
This commit is contained in:
MythEclipse
2026-05-18 20:15:38 +07:00
parent 9d5559a45b
commit 3b9e87ee6c
17 changed files with 1404 additions and 13 deletions
+4
View File
@@ -15,6 +15,7 @@ export interface DashboardSocketHandlers {
onMessageAnalyzed?: (message: MessageRecord) => void;
onAttachmentUploaded?: () => void;
onMediaState?: (state: MediaState) => void;
onVoiceRecordingUploaded?: (recording: any) => void;
onPcm?: (data: ArrayBuffer) => void;
}
@@ -75,6 +76,9 @@ export function useDashboardSocket(handlers: DashboardSocketHandlers) {
case "media_state":
handlersRef.current.onMediaState?.(message.state);
break;
case "voice_recording_uploaded":
handlersRef.current.onVoiceRecordingUploaded?.(message.data);
break;
}
} catch {
// ignore malformed socket messages