0.12.0-2 Checkable Infrastructure

This commit is contained in:
2026-03-19 20:19:07 +00:00
parent 24955a956d
commit d9969dfbe5
20 changed files with 1207 additions and 278 deletions
+22 -8
View File
@@ -94,9 +94,9 @@ class CdPlugin extends SourcePlugin {
* läuft hier in einem einzigen cdRipService.ripAndEncode()-Aufruf.
*
* Pflicht-Felder in ctx.extra:
* ripConfig - { format, formatOptions, selectedTracks, tracks, metadata }
* ripConfig - { format, formatOptions, selectedTracks, tracks, metadata, skipRip, skipEncode }
* rawWavDir - Pfad für temporäre WAV-Dateien (= RAW-Ordner)
* outputDir - Finaler Ausgabeordner
* outputDir - Finaler Ausgabeordner (optional bei skipEncode=true)
* outputTemplate - Template-String für Dateinamen
* isCancelled - () => boolean
* onProcessHandle - (handle) => void [optional]
@@ -118,13 +118,18 @@ class CdPlugin extends SourcePlugin {
outputDir,
outputTemplate,
isCancelled,
onProcessHandle
onProcessHandle,
onProgress: onRawProgress,
onLog: onExternalLog
} = ctx.extra || {};
if (!rawWavDir) {
throw new Error('CdPlugin.rip(): ctx.extra.rawWavDir fehlt');
}
if (!outputDir) {
const skipRip = Boolean(ripConfig?.skipRip);
const skipEncode = Boolean(ripConfig?.skipEncode);
if (!skipEncode && !outputDir) {
throw new Error('CdPlugin.rip(): ctx.extra.outputDir fehlt');
}
@@ -132,8 +137,7 @@ class CdPlugin extends SourcePlugin {
const settings = await ctx.settings.getSettingsMap();
const cdparanoiaCmd = String(cdInfo.cdparanoiaCmd || settings.cdparanoia_command || 'cdparanoia').trim() || 'cdparanoia';
const devicePath = String(job?.disc_device || '').trim();
if (!devicePath) {
if (!devicePath && !skipRip) {
throw new Error('CdPlugin.rip(): Kein CD-Gerätepfad im Job gefunden (disc_device leer).');
}
@@ -189,14 +193,16 @@ class CdPlugin extends SourcePlugin {
ctx.logger.info('cd:rip:start', {
jobId: job?.id,
devicePath,
devicePath: devicePath || null,
skipRip,
skipEncode,
format,
trackCount: selectedTrackPositions.length
});
const result = await cdRipService.ripAndEncode({
jobId: job?.id,
devicePath,
devicePath: devicePath || null,
cdparanoiaCmd,
rawWavDir,
outputDir,
@@ -206,7 +212,12 @@ class CdPlugin extends SourcePlugin {
tracks: mergedTracks,
meta,
outputTemplate: effectiveTemplate,
skipRip,
skipEncode,
onProgress: (progressEvent) => {
if (typeof onRawProgress === 'function') {
onRawProgress(progressEvent);
}
const pct = Number(progressEvent?.percent ?? 0);
const phase = progressEvent?.phase === 'encode' ? 'Encodiere' : 'Rippe';
const trackIdx = progressEvent?.trackIndex || 1;
@@ -220,6 +231,9 @@ class CdPlugin extends SourcePlugin {
if (ctx.logger[level]) {
ctx.logger[level](msg, { jobId: job?.id });
}
if (typeof onExternalLog === 'function') {
onExternalLog(level, msg);
}
},
onProcessHandle,
isCancelled,