feat: add duration field to dataset entries and update related components for display and processing
This commit is contained in:
@@ -66,7 +66,7 @@ export async function downloadFilteredEntries(
|
||||
const row = [
|
||||
`"${entry.externalId}"`,
|
||||
entry.fileName,
|
||||
'',
|
||||
entry.durationMs?.toString() || '',
|
||||
entry.utteranceId || '',
|
||||
`"${(entry.utteranceText || '').replace(/"/g, '""')}"`,
|
||||
entry.speakerId,
|
||||
|
||||
@@ -136,6 +136,7 @@ export async function processDatasetEntries(
|
||||
fileName: relativePath,
|
||||
dialect: row.dialect,
|
||||
iteration: parseInt(row.iteration, 10),
|
||||
durationMs: row.duration_ms ? parseInt(row.duration_ms, 10) : undefined,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +117,11 @@ export default async function DatasetEntryPage({ params }: DatasetEntryPageProps
|
||||
<AudioPlayer datasetId={datasetIdNum} fileName={entry.fileName} externalId={entry.externalId} />
|
||||
</div>
|
||||
|
||||
<div className="bg-white border border-gray-200 p-4 rounded-lg">
|
||||
<p className="text-sm text-gray-600 mb-1">Duration (ms)</p>
|
||||
<p className="text-lg font-semibold">{entry.durationMs?.toLocaleString() || '-'}</p>
|
||||
</div>
|
||||
|
||||
<div className="bg-white border border-gray-200 p-4 rounded-lg">
|
||||
<p className="text-sm text-gray-600 mb-1">Created</p>
|
||||
<p className="text-lg font-semibold">
|
||||
|
||||
@@ -15,6 +15,7 @@ export const dataset_entry = sqliteTable('dataset_entry', {
|
||||
fileName: text('file_name').notNull(),
|
||||
dialect: text('dialect').notNull(),
|
||||
iteration: integer('iteration').notNull(),
|
||||
durationMs: integer('duration_ms'),
|
||||
createdAt: integer('created_at', { mode: 'timestamp' })
|
||||
.notNull()
|
||||
.default(sql`(unixepoch())`),
|
||||
|
||||
Reference in New Issue
Block a user