0.12.0-16 misc fixes
This commit is contained in:
1 parent
76b020d5c0
commit
5284dd2a43
30 files changed
+6955
-896
No files matched your search
@@ -146,6 +146,90 @@ router.post(
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* POST /api/converter/jobs/:jobId/assign-files
|
||||
* Body: { relPaths: string[] }
|
||||
* Fügt ausgewählte Dateien einem bestehenden (nicht gestarteten) Converter-Job hinzu.
|
||||
*/
|
||||
router.post(
|
||||
'/jobs/:jobId/assign-files',
|
||||
asyncHandler(async (req, res) => {
|
||||
const jobId = Number(req.params.jobId);
|
||||
const relPaths = Array.isArray(req.body?.relPaths) ? req.body.relPaths : [];
|
||||
if (!Number.isFinite(jobId) || jobId <= 0) {
|
||||
return res.status(400).json({ detail: 'Ungültige jobId.' });
|
||||
}
|
||||
if (relPaths.length === 0) {
|
||||
return res.status(400).json({ detail: 'Keine Dateien übergeben.' });
|
||||
}
|
||||
logger.info('post:jobs:assign-files', { jobId, count: relPaths.length });
|
||||
const result = await pipelineService.assignConverterFilesToJob(jobId, relPaths);
|
||||
res.json(result);
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* POST /api/converter/jobs/:jobId/remove-file
|
||||
* Body: { relPath: string }
|
||||
* Entfernt eine Datei aus einem bestehenden Converter-Job.
|
||||
*/
|
||||
router.post(
|
||||
'/jobs/:jobId/remove-file',
|
||||
asyncHandler(async (req, res) => {
|
||||
const jobId = Number(req.params.jobId);
|
||||
const relPath = String(req.body?.relPath || '').trim();
|
||||
if (!Number.isFinite(jobId) || jobId <= 0) {
|
||||
return res.status(400).json({ detail: 'Ungültige jobId.' });
|
||||
}
|
||||
if (!relPath) {
|
||||
return res.status(400).json({ detail: 'relPath fehlt.' });
|
||||
}
|
||||
logger.info('post:jobs:remove-file', { jobId, relPath });
|
||||
const result = await pipelineService.removeConverterFileFromJob(jobId, relPath);
|
||||
res.json(result);
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* POST /api/converter/jobs/:jobId/remove-input
|
||||
* Body: { inputPath: string }
|
||||
* Entfernt eine Datei aus einem Converter-Job anhand des absoluten Input-Pfads.
|
||||
*/
|
||||
router.post(
|
||||
'/jobs/:jobId/remove-input',
|
||||
asyncHandler(async (req, res) => {
|
||||
const jobId = Number(req.params.jobId);
|
||||
const inputPath = String(req.body?.inputPath || '').trim();
|
||||
if (!Number.isFinite(jobId) || jobId <= 0) {
|
||||
return res.status(400).json({ detail: 'Ungültige jobId.' });
|
||||
}
|
||||
if (!inputPath) {
|
||||
return res.status(400).json({ detail: 'inputPath fehlt.' });
|
||||
}
|
||||
logger.info('post:jobs:remove-input', { jobId, inputPath });
|
||||
const result = await pipelineService.removeConverterInputFromJob(jobId, inputPath);
|
||||
res.json(result);
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* POST /api/converter/jobs/:jobId/config
|
||||
* Body: partial config draft (outputFormat, presets, metadata, tracks, MusicBrainz-UI-Stand)
|
||||
* Speichert den Draft für READY_TO_START Jobs persistent im encode_plan_json.
|
||||
*/
|
||||
router.post(
|
||||
'/jobs/:jobId/config',
|
||||
asyncHandler(async (req, res) => {
|
||||
const jobId = Number(req.params.jobId);
|
||||
if (!Number.isFinite(jobId) || jobId <= 0) {
|
||||
return res.status(400).json({ detail: 'Ungültige jobId.' });
|
||||
}
|
||||
logger.debug('post:jobs:config', { jobId });
|
||||
const result = await pipelineService.updateConverterJobConfig(jobId, req.body || {});
|
||||
res.json(result);
|
||||
})
|
||||
);
|
||||
|
||||
// ── Datei-Operationen (reines FS, keine DB) ───────────────────────────────
|
||||
|
||||
/**
|
||||
@@ -299,7 +383,7 @@ router.post(
|
||||
asyncHandler(async (req, res) => {
|
||||
const jobId = Number(req.params.jobId);
|
||||
logger.info('post:jobs:cancel', { jobId });
|
||||
const result = await pipelineService.cancelJob(jobId);
|
||||
const result = await pipelineService.cancel(jobId);
|
||||
res.json({ result });
|
||||
})
|
||||
);
|
||||
@@ -313,7 +397,8 @@ router.delete(
|
||||
asyncHandler(async (req, res) => {
|
||||
const jobId = Number(req.params.jobId);
|
||||
logger.info('delete:jobs', { jobId });
|
||||
await historyService.deleteJob(jobId);
|
||||
await historyService.deleteJob(jobId, 'none', { includeRelated: false });
|
||||
await converterScanService.clearAssignmentsForJob(jobId);
|
||||
res.json({ ok: true });
|
||||
})
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user