Skip to content

Commit 63de964

Browse files
committed
feat: enhance session summary to include status and analysis data
1 parent d89f131 commit 63de964

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

src/controllers/session-controller.ts

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ const CreateSessionSchema = z.object({
6060
*
6161
* Contains just enough data for the UI to display a sessions list:
6262
* - Session identifier and creation timestamp
63+
* - Session status for tracking processing state
6364
* - Optional user context (DAW, genre, skill level)
6465
* - Optional file info (duration, format) if metadata extraction succeeded
65-
*
66-
* Full analysis results are NOT included here (use getById for complete state).
66+
* - Optional analysis data for dashboard statistics
6767
*/
6868
type SessionSummary = {
6969
sessionId: string;
7070
createdAt: string;
71+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
7172
userContext?: {
7273
daw?: string;
7374
genre?: string;
@@ -80,6 +81,24 @@ type SessionSummary = {
8081
channels: number;
8182
bitrate?: number;
8283
};
84+
analysis?: {
85+
loudness?: {
86+
integratedLUFS: number;
87+
truePeak: number;
88+
loudnessRange: number;
89+
};
90+
dynamics?: {
91+
crestFactor: number;
92+
};
93+
spectrum?: {
94+
low: number;
95+
mids: number;
96+
highs: number;
97+
};
98+
stereo?: {
99+
widthScore: number;
100+
};
101+
};
83102
};
84103

85104
/**
@@ -213,14 +232,16 @@ export class SessionController {
213232

214233
const sessions = await this.sessionRepository.findAll(userId);
215234

216-
// Transform database records to lightweight summaries
235+
// Transform database records to summaries with analysis data
217236
const summaries: SessionSummary[] = sessions.map((session) => {
218237
const state = JSON.parse(session.payload) as EngineState;
219238
return {
220239
sessionId: session.sessionId,
221240
createdAt: session.createdAt.toISOString(),
241+
status: session.status,
222242
userContext: state.userContext,
223243
fileInfo: state.fileInfo,
244+
analysis: state.analysis,
224245
};
225246
});
226247

0 commit comments

Comments
 (0)