refactor(transcript): drop Tonemark rewrite
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { json, error } from '@sveltejs/kit';
|
||||
import { getJob, updateJob } from '$lib/server/db.js';
|
||||
import { deduplicateSegments } from '$lib/server/postprocess.js';
|
||||
import { writeOutputs } from '$lib/server/formatter.js';
|
||||
import type { Segment } from '$lib/types.js';
|
||||
|
||||
/** POST /api/jobs/[id]/reprocess — re-run post-processing and regenerate all output files. */
|
||||
/** POST /api/jobs/[id]/reprocess — regenerate output files from stored canonical segments. */
|
||||
export async function POST({ params }) {
|
||||
const job = getJob(params.id);
|
||||
if (!job) throw error(404, 'Job not found');
|
||||
@@ -14,8 +13,7 @@ export async function POST({ params }) {
|
||||
}
|
||||
|
||||
try {
|
||||
const rawSegments = JSON.parse(job.segmentsJson) as Segment[];
|
||||
const segments = deduplicateSegments(rawSegments);
|
||||
const segments = JSON.parse(job.segmentsJson) as Segment[];
|
||||
|
||||
const paths = await writeOutputs(segments, job.title, job.id);
|
||||
const outputDir = paths.srt.replace(/\/[^/]+$/, '');
|
||||
|
||||
Reference in New Issue
Block a user