0.12.0-7 remove legacy
This commit is contained in:
@@ -4007,93 +4007,12 @@ class PipelineService extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
async isPluginArchitectureEnabled() {
|
||||
return this.isPluginArchitectureEnabledForPlugin(null);
|
||||
}
|
||||
|
||||
getPluginArchitectureSettingKey(pluginId = null) {
|
||||
const normalizedPluginId = String(pluginId || '').trim().toLowerCase();
|
||||
if (!normalizedPluginId) {
|
||||
return null;
|
||||
}
|
||||
const byPluginId = {
|
||||
bluray: 'use_plugin_architecture_bluray',
|
||||
dvd: 'use_plugin_architecture_dvd',
|
||||
cd: 'use_plugin_architecture_cd',
|
||||
audiobook: 'use_plugin_architecture_audiobook'
|
||||
};
|
||||
return byPluginId[normalizedPluginId] || null;
|
||||
}
|
||||
|
||||
isPluginArchitectureEnabledForSettings(settingsMap = null, pluginId = null, phase = null) {
|
||||
const settings = settingsMap && typeof settingsMap === 'object' ? settingsMap : {};
|
||||
const globalEnabled = this.normalizeBooleanSetting(settings.use_plugin_architecture);
|
||||
if (!globalEnabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const pluginSettingKey = this.getPluginArchitectureSettingKey(pluginId);
|
||||
if (!pluginSettingKey) {
|
||||
return globalEnabled;
|
||||
}
|
||||
|
||||
if (!(pluginSettingKey in settings)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!this.normalizeBooleanSetting(settings[pluginSettingKey])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Phasen-spezifischer Toggle: use_plugin_architecture_{id}_{phase}
|
||||
if (phase) {
|
||||
const normalizedId = String(pluginId || '').trim().toLowerCase();
|
||||
const phaseKey = `use_plugin_architecture_${normalizedId}_${phase}`;
|
||||
if (phaseKey in settings && !this.normalizeBooleanSetting(settings[phaseKey])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
async isPluginArchitectureEnabledForPlugin(pluginId = null, phase = null) {
|
||||
try {
|
||||
const settingsMap = await settingsService.getSettingsMap();
|
||||
return this.isPluginArchitectureEnabledForSettings(settingsMap, pluginId, phase);
|
||||
} catch (error) {
|
||||
logger.warn('plugin-architecture:settings-read-failed', {
|
||||
error: errorToMeta(error),
|
||||
pluginId: pluginId || null,
|
||||
phase: phase || null
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async resolveAnalyzePlugin(discInfo = null, phase = 'analyze') {
|
||||
const enabled = await this.isPluginArchitectureEnabledForPlugin(null);
|
||||
if (!enabled) {
|
||||
return null;
|
||||
}
|
||||
async resolveAnalyzePlugin(discInfo = null) {
|
||||
const registry = this.ensureSourcePluginRegistry();
|
||||
if (!registry) {
|
||||
return null;
|
||||
}
|
||||
const plugin = registry.findPlugin(discInfo);
|
||||
if (!plugin?.id) {
|
||||
return null;
|
||||
}
|
||||
const pluginEnabled = await this.isPluginArchitectureEnabledForPlugin(plugin.id, phase);
|
||||
if (!pluginEnabled) {
|
||||
logger.info('plugin-architecture:plugin-phase-disabled', {
|
||||
pluginId: plugin.id,
|
||||
phase,
|
||||
mediaProfile: discInfo?.mediaProfile || null
|
||||
});
|
||||
return null;
|
||||
}
|
||||
return plugin;
|
||||
return registry.findPlugin(discInfo) || null;
|
||||
}
|
||||
|
||||
sanitizePluginExecutionState(rawState = null) {
|
||||
@@ -7284,11 +7203,6 @@ class PipelineService extends EventEmitter {
|
||||
});
|
||||
const settings = await settingsService.getEffectiveSettingsMap(mediaProfile);
|
||||
const reviewPlugin = await this.resolveAnalyzePlugin({ mediaProfile }, 'review').catch(() => null);
|
||||
const reviewPluginEnabled = Boolean(
|
||||
reviewPlugin
|
||||
&& reviewPlugin.id === mediaProfile
|
||||
&& typeof reviewPlugin.review === 'function'
|
||||
);
|
||||
let reviewPluginExecution = null;
|
||||
const analyzeContext = mkInfo?.analyzeContext || {};
|
||||
const playlistAnalysis = analyzeContext.playlistAnalysis || this.snapshot.context?.playlistAnalysis || null;
|
||||
@@ -7340,42 +7254,20 @@ class PipelineService extends EventEmitter {
|
||||
const lines = [];
|
||||
let runInfo = null;
|
||||
let sourceArg = null;
|
||||
if (reviewPluginEnabled) {
|
||||
const pluginScan = await this.runPluginReviewScan(reviewPlugin, job, {
|
||||
jobId,
|
||||
deviceInfo,
|
||||
reviewMode: 'pre_rip',
|
||||
source: 'HANDBRAKE_SCAN',
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
lines.push(...pluginScan.scanLines);
|
||||
runInfo = pluginScan.runInfo || null;
|
||||
sourceArg = pluginScan.sourceArg || null;
|
||||
reviewPluginExecution = this.mergePluginExecutionState(
|
||||
reviewPluginExecution,
|
||||
pluginScan.pluginExecution
|
||||
);
|
||||
} else {
|
||||
const scanConfig = await settingsService.buildHandBrakeScanConfig(deviceInfo, { mediaProfile });
|
||||
logger.info('disc-track-review:command', {
|
||||
jobId,
|
||||
cmd: scanConfig.cmd,
|
||||
args: scanConfig.args,
|
||||
sourceArg: scanConfig.sourceArg,
|
||||
selectedTitleId: selectedMakemkvTitleId
|
||||
});
|
||||
|
||||
runInfo = await this.runCommand({
|
||||
jobId,
|
||||
stage: 'MEDIAINFO_CHECK',
|
||||
source: 'HANDBRAKE_SCAN',
|
||||
cmd: scanConfig.cmd,
|
||||
args: scanConfig.args,
|
||||
collectLines: lines,
|
||||
collectStderrLines: false
|
||||
});
|
||||
sourceArg = scanConfig.sourceArg;
|
||||
}
|
||||
const pluginScan = await this.runPluginReviewScan(reviewPlugin, job, {
|
||||
jobId,
|
||||
deviceInfo,
|
||||
reviewMode: 'pre_rip',
|
||||
source: 'HANDBRAKE_SCAN',
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
lines.push(...pluginScan.scanLines);
|
||||
runInfo = pluginScan.runInfo || null;
|
||||
sourceArg = pluginScan.sourceArg || null;
|
||||
reviewPluginExecution = this.mergePluginExecutionState(
|
||||
reviewPluginExecution,
|
||||
pluginScan.pluginExecution
|
||||
);
|
||||
|
||||
const parsed = parseMediainfoJsonOutput(lines.join('\n'));
|
||||
if (!parsed) {
|
||||
@@ -7533,11 +7425,6 @@ class PipelineService extends EventEmitter {
|
||||
});
|
||||
const settings = await settingsService.getEffectiveSettingsMap(mediaProfile);
|
||||
const reviewPlugin = await this.resolveAnalyzePlugin({ mediaProfile }, 'review').catch(() => null);
|
||||
const reviewPluginEnabled = Boolean(
|
||||
reviewPlugin
|
||||
&& reviewPlugin.id === mediaProfile
|
||||
&& typeof reviewPlugin.review === 'function'
|
||||
);
|
||||
let reviewPluginExecution = null;
|
||||
const analyzeContext = mkInfo?.analyzeContext || {};
|
||||
let playlistAnalysis = forceFreshAnalyze
|
||||
@@ -7699,39 +7586,18 @@ class PipelineService extends EventEmitter {
|
||||
);
|
||||
try {
|
||||
const resolveScanLines = [];
|
||||
if (reviewPluginEnabled) {
|
||||
const pluginScan = await this.runPluginReviewScan(reviewPlugin, job, {
|
||||
jobId,
|
||||
rawPath,
|
||||
reviewMode: 'rip',
|
||||
source: 'HANDBRAKE_SCAN_PLAYLIST_MAP',
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
resolveScanLines.push(...pluginScan.scanLines);
|
||||
reviewPluginExecution = this.mergePluginExecutionState(
|
||||
reviewPluginExecution,
|
||||
pluginScan.pluginExecution
|
||||
);
|
||||
} else {
|
||||
const resolveScanConfig = await settingsService.buildHandBrakeScanConfigForInput(rawPath, { mediaProfile });
|
||||
logger.info('backup-track-review:handbrake-predecision-command', {
|
||||
jobId,
|
||||
cmd: resolveScanConfig.cmd,
|
||||
args: resolveScanConfig.args,
|
||||
sourceArg: resolveScanConfig.sourceArg,
|
||||
candidatePlaylists: playlistCandidates.map((item) => item.playlistFile || item.playlistId)
|
||||
});
|
||||
|
||||
await this.runCommand({
|
||||
jobId,
|
||||
stage: 'MEDIAINFO_CHECK',
|
||||
source: 'HANDBRAKE_SCAN_PLAYLIST_MAP',
|
||||
cmd: resolveScanConfig.cmd,
|
||||
args: resolveScanConfig.args,
|
||||
collectLines: resolveScanLines,
|
||||
collectStderrLines: false
|
||||
});
|
||||
}
|
||||
const pluginScan = await this.runPluginReviewScan(reviewPlugin, job, {
|
||||
jobId,
|
||||
rawPath,
|
||||
reviewMode: 'rip',
|
||||
source: 'HANDBRAKE_SCAN_PLAYLIST_MAP',
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
resolveScanLines.push(...pluginScan.scanLines);
|
||||
reviewPluginExecution = this.mergePluginExecutionState(
|
||||
reviewPluginExecution,
|
||||
pluginScan.pluginExecution
|
||||
);
|
||||
|
||||
const resolveScanJson = parseMediainfoJsonOutput(resolveScanLines.join('\n'));
|
||||
if (resolveScanJson) {
|
||||
@@ -7753,16 +7619,9 @@ class PipelineService extends EventEmitter {
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (reviewPluginEnabled) {
|
||||
const error = new Error('HandBrake Playlist-Trackdaten konnten nicht geparst werden (Plugin-Review aktiv, kein Fallback).');
|
||||
error.runInfo = null;
|
||||
throw error;
|
||||
}
|
||||
await historyService.appendLog(
|
||||
jobId,
|
||||
'SYSTEM',
|
||||
'HandBrake Playlist-Trackdaten konnten nicht geparst werden (Warteansicht ohne Audiodetails).'
|
||||
);
|
||||
const error = new Error('HandBrake Playlist-Trackdaten konnten nicht geparst werden.');
|
||||
error.runInfo = null;
|
||||
throw error;
|
||||
}
|
||||
} catch (error) {
|
||||
logger.warn('backup-track-review:handbrake-predecision-failed', {
|
||||
@@ -7774,9 +7633,7 @@ class PipelineService extends EventEmitter {
|
||||
'SYSTEM',
|
||||
`HandBrake Voranalyse für Playlist-Auswahl fehlgeschlagen: ${error.message}`
|
||||
);
|
||||
if (reviewPluginEnabled) {
|
||||
throw error;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
} else {
|
||||
playlistAnalysis = enrichPlaylistAnalysisWithHandBrakeCache(playlistAnalysis, handBrakePlaylistScan);
|
||||
@@ -8024,42 +7881,19 @@ class PipelineService extends EventEmitter {
|
||||
} else {
|
||||
try {
|
||||
const resolveScanLines = [];
|
||||
if (reviewPluginEnabled) {
|
||||
const pluginScan = await this.runPluginReviewScan(reviewPlugin, job, {
|
||||
jobId,
|
||||
rawPath,
|
||||
reviewMode: 'rip',
|
||||
source: 'HANDBRAKE_SCAN_PLAYLIST_MAP',
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
resolveScanLines.push(...pluginScan.scanLines);
|
||||
handBrakeResolveRunInfo = pluginScan.runInfo || null;
|
||||
reviewPluginExecution = this.mergePluginExecutionState(
|
||||
reviewPluginExecution,
|
||||
pluginScan.pluginExecution
|
||||
);
|
||||
} else {
|
||||
const resolveScanConfig = await settingsService.buildHandBrakeScanConfigForInput(rawPath, { mediaProfile });
|
||||
logger.info('backup-track-review:handbrake-resolve-command', {
|
||||
jobId,
|
||||
cmd: resolveScanConfig.cmd,
|
||||
args: resolveScanConfig.args,
|
||||
sourceArg: resolveScanConfig.sourceArg,
|
||||
selectedPlaylistId: resolvedPlaylistId,
|
||||
selectedMakemkvTitleId: selectedTitleForReview
|
||||
});
|
||||
|
||||
handBrakeResolveRunInfo = await this.runCommand({
|
||||
jobId,
|
||||
stage: 'MEDIAINFO_CHECK',
|
||||
source: 'HANDBRAKE_SCAN_PLAYLIST_MAP',
|
||||
cmd: resolveScanConfig.cmd,
|
||||
args: resolveScanConfig.args,
|
||||
collectLines: resolveScanLines,
|
||||
collectStderrLines: false,
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
}
|
||||
const pluginScan = await this.runPluginReviewScan(reviewPlugin, job, {
|
||||
jobId,
|
||||
rawPath,
|
||||
reviewMode: 'rip',
|
||||
source: 'HANDBRAKE_SCAN_PLAYLIST_MAP',
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
resolveScanLines.push(...pluginScan.scanLines);
|
||||
handBrakeResolveRunInfo = pluginScan.runInfo || null;
|
||||
reviewPluginExecution = this.mergePluginExecutionState(
|
||||
reviewPluginExecution,
|
||||
pluginScan.pluginExecution
|
||||
);
|
||||
|
||||
const resolveScanJson = parseMediainfoJsonOutput(resolveScanLines.join('\n'));
|
||||
if (!resolveScanJson) {
|
||||
@@ -9887,11 +9721,6 @@ class PipelineService extends EventEmitter {
|
||||
});
|
||||
const settings = await settingsService.getEffectiveSettingsMap(mediaProfile);
|
||||
const reviewPlugin = await this.resolveAnalyzePlugin({ mediaProfile }, 'review').catch(() => null);
|
||||
const reviewPluginEnabled = Boolean(
|
||||
reviewPlugin
|
||||
&& reviewPlugin.id === mediaProfile
|
||||
&& typeof reviewPlugin.review === 'function'
|
||||
);
|
||||
let reviewPluginExecution = null;
|
||||
const analyzeContext = mkInfo?.analyzeContext || {};
|
||||
const selectedPlaylistId = normalizePlaylistId(
|
||||
@@ -10025,42 +9854,19 @@ class PipelineService extends EventEmitter {
|
||||
|
||||
const dvdScanLines = [];
|
||||
let dvdScanRunInfo = null;
|
||||
if (reviewPluginEnabled) {
|
||||
const pluginScan = await this.runPluginReviewScan(reviewPlugin, job, {
|
||||
jobId,
|
||||
rawPath: dvdHandBrakeScanInputPath,
|
||||
reviewMode: 'rip',
|
||||
source: 'HANDBRAKE_SCAN_DVD',
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
dvdScanLines.push(...pluginScan.scanLines);
|
||||
dvdScanRunInfo = pluginScan.runInfo || null;
|
||||
reviewPluginExecution = this.mergePluginExecutionState(
|
||||
reviewPluginExecution,
|
||||
pluginScan.pluginExecution
|
||||
);
|
||||
} else {
|
||||
const dvdScanConfig = await settingsService.buildHandBrakeScanConfigForInput(dvdHandBrakeScanInputPath, {
|
||||
mediaProfile,
|
||||
settingsMap: settings
|
||||
});
|
||||
logger.info('mediainfo:review:dvd-handbrake-scan:command', {
|
||||
jobId,
|
||||
dvdHandBrakeScanInputPath,
|
||||
cmd: dvdScanConfig.cmd,
|
||||
args: dvdScanConfig.args
|
||||
});
|
||||
|
||||
dvdScanRunInfo = await this.runCommand({
|
||||
jobId,
|
||||
stage: 'MEDIAINFO_CHECK',
|
||||
source: 'HANDBRAKE_SCAN_DVD',
|
||||
cmd: dvdScanConfig.cmd,
|
||||
args: dvdScanConfig.args,
|
||||
collectLines: dvdScanLines,
|
||||
collectStderrLines: false
|
||||
});
|
||||
}
|
||||
const pluginScan = await this.runPluginReviewScan(reviewPlugin, job, {
|
||||
jobId,
|
||||
rawPath: dvdHandBrakeScanInputPath,
|
||||
reviewMode: 'rip',
|
||||
source: 'HANDBRAKE_SCAN_DVD',
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
dvdScanLines.push(...pluginScan.scanLines);
|
||||
dvdScanRunInfo = pluginScan.runInfo || null;
|
||||
reviewPluginExecution = this.mergePluginExecutionState(
|
||||
reviewPluginExecution,
|
||||
pluginScan.pluginExecution
|
||||
);
|
||||
|
||||
dvdHandBrakeScanJson = parseMediainfoJsonOutput(dvdScanLines.join('\n'));
|
||||
if (dvdHandBrakeScanJson) {
|
||||
@@ -10077,28 +9883,15 @@ class PipelineService extends EventEmitter {
|
||||
'SYSTEM',
|
||||
`HandBrake DVD-Scan: Audio=${audioCount}, Subtitle=${subtitleCount}, Dauer=${formatDurationClock(titleInfo.durationSeconds)}`
|
||||
);
|
||||
} else if (reviewPluginEnabled) {
|
||||
const error = new Error('HandBrake DVD-Scan: Kein Titel erkannt (Plugin-Review aktiv, kein Fallback).');
|
||||
} else {
|
||||
const error = new Error('HandBrake DVD-Scan: Kein Titel erkannt.');
|
||||
error.runInfo = dvdScanRunInfo;
|
||||
throw error;
|
||||
} else {
|
||||
await historyService.appendLog(
|
||||
jobId,
|
||||
'SYSTEM',
|
||||
'HandBrake DVD-Scan: Kein Titel erkannt, falle auf MediaInfo zurück.'
|
||||
);
|
||||
dvdHandBrakeScanJson = null;
|
||||
}
|
||||
} else if (reviewPluginEnabled) {
|
||||
const error = new Error('HandBrake DVD-Scan: Ausgabe nicht lesbar (Plugin-Review aktiv, kein Fallback).');
|
||||
} else {
|
||||
const error = new Error('HandBrake DVD-Scan: Ausgabe nicht lesbar.');
|
||||
error.runInfo = dvdScanRunInfo;
|
||||
throw error;
|
||||
} else {
|
||||
await historyService.appendLog(
|
||||
jobId,
|
||||
'SYSTEM',
|
||||
'HandBrake DVD-Scan: Ausgabe nicht lesbar, falle auf MediaInfo zurück.'
|
||||
);
|
||||
}
|
||||
|
||||
mediaInfoRuns.push({ filePath: dvdHandBrakeScanInputPath, runInfo: dvdScanRunInfo, fallbackRunInfo: null });
|
||||
@@ -10282,41 +10075,19 @@ class PipelineService extends EventEmitter {
|
||||
await this.updateProgress('MEDIAINFO_CHECK', 100, null, 'HandBrake DVD Titel-Scan läuft', jobId);
|
||||
const dvdTitleScanLines = [];
|
||||
let dvdTitleScanRunInfo = null;
|
||||
if (reviewPluginEnabled) {
|
||||
const pluginScan = await this.runPluginReviewScan(reviewPlugin, job, {
|
||||
jobId,
|
||||
rawPath: dvdScanInputPath,
|
||||
reviewMode: 'rip',
|
||||
source: 'HANDBRAKE_SCAN_DVD_TITLES',
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
dvdTitleScanLines.push(...pluginScan.scanLines);
|
||||
dvdTitleScanRunInfo = pluginScan.runInfo || null;
|
||||
reviewPluginExecution = this.mergePluginExecutionState(
|
||||
reviewPluginExecution,
|
||||
pluginScan.pluginExecution
|
||||
);
|
||||
} else {
|
||||
const dvdTitleScanConfig = await settingsService.buildHandBrakeScanConfigForInput(dvdScanInputPath, {
|
||||
mediaProfile,
|
||||
settingsMap: settings
|
||||
});
|
||||
logger.info('mediainfo:review:dvd-title-scan:command', {
|
||||
jobId,
|
||||
cmd: dvdTitleScanConfig.cmd,
|
||||
args: dvdTitleScanConfig.args,
|
||||
dvdScanInputPath
|
||||
});
|
||||
dvdTitleScanRunInfo = await this.runCommand({
|
||||
jobId,
|
||||
stage: 'MEDIAINFO_CHECK',
|
||||
source: 'HANDBRAKE_SCAN_DVD_TITLES',
|
||||
cmd: dvdTitleScanConfig.cmd,
|
||||
args: dvdTitleScanConfig.args,
|
||||
collectLines: dvdTitleScanLines,
|
||||
collectStderrLines: false
|
||||
});
|
||||
}
|
||||
const pluginScan = await this.runPluginReviewScan(reviewPlugin, job, {
|
||||
jobId,
|
||||
rawPath: dvdScanInputPath,
|
||||
reviewMode: 'rip',
|
||||
source: 'HANDBRAKE_SCAN_DVD_TITLES',
|
||||
silent: !this.isPrimaryJob(jobId)
|
||||
});
|
||||
dvdTitleScanLines.push(...pluginScan.scanLines);
|
||||
dvdTitleScanRunInfo = pluginScan.runInfo || null;
|
||||
reviewPluginExecution = this.mergePluginExecutionState(
|
||||
reviewPluginExecution,
|
||||
pluginScan.pluginExecution
|
||||
);
|
||||
dvdTitleScanJson = parseMediainfoJsonOutput(dvdTitleScanLines.join('\n'));
|
||||
if (dvdTitleScanJson) {
|
||||
const allTitles = parseHandBrakeTitleList(dvdTitleScanJson);
|
||||
@@ -10408,18 +10179,10 @@ class PipelineService extends EventEmitter {
|
||||
);
|
||||
enrichedReview = { ...enrichedReview, encodeInputPath: dvdScanInputPath };
|
||||
}
|
||||
} else if (reviewPluginEnabled) {
|
||||
const error = new Error('HandBrake DVD Titel-Scan: Ausgabe nicht lesbar (Plugin-Review aktiv, kein Fallback).');
|
||||
} else {
|
||||
const error = new Error('HandBrake DVD Titel-Scan: Ausgabe nicht lesbar.');
|
||||
error.runInfo = dvdTitleScanRunInfo;
|
||||
throw error;
|
||||
} else {
|
||||
logger.warn('mediainfo:review:dvd-title-scan:parse-failed', { jobId });
|
||||
await historyService.appendLog(
|
||||
jobId,
|
||||
'SYSTEM',
|
||||
'HandBrake DVD Titel-Scan: Ausgabe nicht lesbar. Ohne Titel-ID fortgefahren.'
|
||||
);
|
||||
enrichedReview = { ...enrichedReview, encodeInputPath: dvdScanInputPath };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10947,11 +10710,6 @@ class PipelineService extends EventEmitter {
|
||||
});
|
||||
const settings = await settingsService.getEffectiveSettingsMap(mediaProfile);
|
||||
const encodePlugin = await this.resolveAnalyzePlugin({ mediaProfile }, 'encode').catch(() => null);
|
||||
const encodePluginEnabled = Boolean(
|
||||
encodePlugin
|
||||
&& encodePlugin.id === mediaProfile
|
||||
&& typeof encodePlugin.encode === 'function'
|
||||
);
|
||||
let encodePluginExecution = null;
|
||||
const resolvedRawPath = this.resolveCurrentRawPathForSettings(settings, mediaProfile, job.raw_path);
|
||||
const activeRawPath = resolvedRawPath || String(job.raw_path || '').trim() || null;
|
||||
@@ -11292,45 +11050,26 @@ class PipelineService extends EventEmitter {
|
||||
}
|
||||
: parseHandBrakeProgress;
|
||||
let handbrakeInfo = null;
|
||||
if (encodePluginEnabled) {
|
||||
const encodeCtx = await this.buildPluginContext(encodePlugin.id, {
|
||||
jobId,
|
||||
inputPath,
|
||||
outputPath: incompleteOutputPath,
|
||||
encodePlan: effectiveEncodePlan,
|
||||
runCommand: this.runCommand.bind(this),
|
||||
progressParser: handBrakeProgressParser,
|
||||
encodeSource: 'HANDBRAKE',
|
||||
encodeStage: 'ENCODING'
|
||||
});
|
||||
handbrakeInfo = await encodePlugin.encode(job, encodeCtx);
|
||||
encodePluginExecution = this.mergePluginExecutionState(
|
||||
encodePluginExecution,
|
||||
this.sanitizePluginExecutionState(encodeCtx.getPluginExecution())
|
||||
);
|
||||
logger.info('plugin:encode:used', {
|
||||
jobId,
|
||||
pluginId: encodePlugin.id,
|
||||
mediaProfile
|
||||
});
|
||||
} else {
|
||||
const handBrakeConfig = await settingsService.buildHandBrakeConfig(inputPath, incompleteOutputPath, {
|
||||
trackSelection,
|
||||
titleId: handBrakeTitleId,
|
||||
mediaProfile,
|
||||
settingsMap: settings,
|
||||
userPreset: encodePlan?.userPreset || null
|
||||
});
|
||||
logger.info('encoding:command', { jobId, cmd: handBrakeConfig.cmd, args: handBrakeConfig.args });
|
||||
handbrakeInfo = await this.runCommand({
|
||||
jobId,
|
||||
stage: 'ENCODING',
|
||||
source: 'HANDBRAKE',
|
||||
cmd: handBrakeConfig.cmd,
|
||||
args: handBrakeConfig.args,
|
||||
parser: handBrakeProgressParser
|
||||
});
|
||||
}
|
||||
const encodeCtx = await this.buildPluginContext(encodePlugin.id, {
|
||||
jobId,
|
||||
inputPath,
|
||||
outputPath: incompleteOutputPath,
|
||||
encodePlan: effectiveEncodePlan,
|
||||
runCommand: this.runCommand.bind(this),
|
||||
progressParser: handBrakeProgressParser,
|
||||
encodeSource: 'HANDBRAKE',
|
||||
encodeStage: 'ENCODING'
|
||||
});
|
||||
handbrakeInfo = await encodePlugin.encode(job, encodeCtx);
|
||||
encodePluginExecution = this.mergePluginExecutionState(
|
||||
encodePluginExecution,
|
||||
this.sanitizePluginExecutionState(encodeCtx.getPluginExecution())
|
||||
);
|
||||
logger.info('plugin:encode:used', {
|
||||
jobId,
|
||||
pluginId: encodePlugin.id,
|
||||
mediaProfile
|
||||
});
|
||||
const outputFinalization = finalizeOutputPathForCompletedEncode(
|
||||
incompleteOutputPath,
|
||||
preferredFinalOutputPath
|
||||
@@ -11650,20 +11389,6 @@ class PipelineService extends EventEmitter {
|
||||
try {
|
||||
await this.ensureMakeMKVRegistration(jobId, 'RIPPING');
|
||||
|
||||
const ripConfig = await settingsService.buildMakeMKVRipConfig(rawJobDir, device, {
|
||||
selectedTitleId: effectiveSelectedTitleId,
|
||||
mediaProfile,
|
||||
settingsMap: settings,
|
||||
backupOutputBase
|
||||
});
|
||||
logger.info('rip:command', {
|
||||
jobId,
|
||||
cmd: ripConfig.cmd,
|
||||
args: ripConfig.args,
|
||||
ripMode,
|
||||
selectedPlaylist: effectiveSelectedPlaylistFile,
|
||||
selectedTitleId: effectiveSelectedTitleId
|
||||
});
|
||||
if (ripMode === 'backup') {
|
||||
await historyService.appendLog(
|
||||
jobId,
|
||||
@@ -11702,28 +11427,16 @@ class PipelineService extends EventEmitter {
|
||||
}
|
||||
let ripCommandSucceeded = false;
|
||||
try {
|
||||
if (ripPlugin) {
|
||||
// Plugin-Pfad: VideoDiscPlugin.rip() baut eigene ripConfig + ruft ctx.extra.runCommand()
|
||||
const ripCtx = await this.buildPluginContext(ripPlugin.id, {
|
||||
jobId,
|
||||
rawJobDir,
|
||||
deviceInfo: device,
|
||||
selectedTitleId: effectiveSelectedTitleId,
|
||||
backupOutputBase,
|
||||
runCommand: this.runCommand.bind(this)
|
||||
});
|
||||
makemkvInfo = await ripPlugin.rip(job, ripCtx);
|
||||
} else {
|
||||
// Legacy-Pfad
|
||||
makemkvInfo = await this.runCommand({
|
||||
jobId,
|
||||
stage: 'RIPPING',
|
||||
source: 'MAKEMKV_RIP',
|
||||
cmd: ripConfig.cmd,
|
||||
args: ripConfig.args,
|
||||
parser: parseMakeMkvProgress
|
||||
});
|
||||
}
|
||||
// Plugin-Pfad: VideoDiscPlugin.rip() baut eigene ripConfig + ruft ctx.extra.runCommand()
|
||||
const ripCtx = await this.buildPluginContext(ripPlugin.id, {
|
||||
jobId,
|
||||
rawJobDir,
|
||||
deviceInfo: device,
|
||||
selectedTitleId: effectiveSelectedTitleId,
|
||||
backupOutputBase,
|
||||
runCommand: this.runCommand.bind(this)
|
||||
});
|
||||
makemkvInfo = await ripPlugin.rip(job, ripCtx);
|
||||
ripCommandSucceeded = true;
|
||||
} finally {
|
||||
if (devicePath && !ripCommandSucceeded) {
|
||||
@@ -15292,11 +15005,11 @@ class PipelineService extends EventEmitter {
|
||||
activeJobId,
|
||||
'SYSTEM',
|
||||
skipRip
|
||||
? `CD-Encode aus RAW gestartet (${cdRipPlugin ? 'Plugin' : 'Legacy'}): Format=${format}, Tracks=${effectiveSelectedTrackPositions.join(',') || 'alle'}`
|
||||
? `CD-Encode aus RAW gestartet: Format=${format}, Tracks=${effectiveSelectedTrackPositions.join(',') || 'alle'}`
|
||||
: (
|
||||
skipEncode
|
||||
? `CD-RAW-Rip gestartet (${cdRipPlugin ? 'Plugin' : 'Legacy'}): Tracks=${effectiveSelectedTrackPositions.join(',') || 'alle'}`
|
||||
: `CD-Rip gestartet (${cdRipPlugin ? 'Plugin' : 'Legacy'}): Format=${format}, Tracks=${effectiveSelectedTrackPositions.join(',') || 'alle'}`
|
||||
? `CD-RAW-Rip gestartet: Tracks=${effectiveSelectedTrackPositions.join(',') || 'alle'}`
|
||||
: `CD-Rip gestartet: Format=${format}, Tracks=${effectiveSelectedTrackPositions.join(',') || 'alle'}`
|
||||
)
|
||||
);
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user