0.12.0-2 Checkable Infrastructure
This commit is contained in:
@@ -731,6 +731,16 @@ function buildPipelineFromJob(job, currentPipeline, currentPipelineJobId) {
|
||||
&& !processingStates.includes(jobStatus)
|
||||
&& resolvedMediaType !== 'audiobook'
|
||||
);
|
||||
const cdSkipRipReady = Boolean(
|
||||
resolvedMediaType === 'cd'
|
||||
&& (
|
||||
Boolean(encodePlan?.skipRip)
|
||||
|| (
|
||||
Number(job?.rip_successful || 0) === 1
|
||||
&& Boolean(String(job?.raw_path || '').trim())
|
||||
)
|
||||
)
|
||||
);
|
||||
const computedContext = {
|
||||
jobId,
|
||||
rawPath: job?.raw_path || null,
|
||||
@@ -741,6 +751,7 @@ function buildPipelineFromJob(job, currentPipeline, currentPipelineJobId) {
|
||||
devicePath,
|
||||
cdparanoiaCmd,
|
||||
cdparanoiaCommandPreview,
|
||||
skipRip: cdSkipRipReady ? true : undefined,
|
||||
cdRipConfig,
|
||||
tracks: cdTracks,
|
||||
inputPath,
|
||||
@@ -1777,6 +1788,58 @@ export default function DashboardPage({
|
||||
}
|
||||
};
|
||||
|
||||
const handleDeleteDashboardJob = async (jobId) => {
|
||||
const normalizedJobId = normalizeJobId(jobId);
|
||||
if (!normalizedJobId) {
|
||||
return;
|
||||
}
|
||||
const job = dashboardJobs.find((item) => normalizeJobId(item?.id) === normalizedJobId) || null;
|
||||
const title = String(job?.title || job?.detected_title || `Job #${normalizedJobId}`).trim();
|
||||
const confirmed = window.confirm(
|
||||
`Job #${normalizedJobId} wirklich löschen?\n` +
|
||||
`${title}\n\n` +
|
||||
'Hinweis: Dateien bleiben erhalten. Das zugeordnete Laufwerk wird freigegeben und auf Leerzustand zurückgesetzt.'
|
||||
);
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
setJobBusy(normalizedJobId, true);
|
||||
try {
|
||||
const statusBeforeDelete = String(job?.status || '').trim().toUpperCase();
|
||||
if (processingStates.includes(statusBeforeDelete)) {
|
||||
await api.cancelPipeline(normalizedJobId);
|
||||
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
for (let attempt = 0; attempt < 12; attempt += 1) {
|
||||
const latest = await api.getJob(normalizedJobId, { lite: true, forceRefresh: true }).catch(() => null);
|
||||
const latestStatus = String(latest?.job?.status || latest?.job?.last_state || '').trim().toUpperCase();
|
||||
if (!processingStates.includes(latestStatus)) {
|
||||
break;
|
||||
}
|
||||
await wait(250);
|
||||
}
|
||||
}
|
||||
await api.deleteJobEntry(normalizedJobId, 'none', {
|
||||
includeRelated: false,
|
||||
resetDriveState: true,
|
||||
keepDetectedDevice: false
|
||||
});
|
||||
await refreshPipeline();
|
||||
await loadDashboardJobs();
|
||||
setExpandedJobId((prev) => (normalizeJobId(prev) === normalizedJobId ? null : prev));
|
||||
toastRef.current?.show({
|
||||
severity: 'success',
|
||||
summary: 'Job gelöscht',
|
||||
detail: `Job #${normalizedJobId} wurde entfernt.`,
|
||||
life: 3200
|
||||
});
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
} finally {
|
||||
setJobBusy(normalizedJobId, false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleRestartEncodeWithLastSettings = async (jobId) => {
|
||||
const job = dashboardJobs.find((item) => normalizeJobId(item?.id) === normalizeJobId(jobId)) || null;
|
||||
const title = job?.title || job?.detected_title || `Job #${jobId}`;
|
||||
@@ -2702,6 +2765,7 @@ export default function DashboardPage({
|
||||
onCancel={() => handleCancel(jobId, jobState)}
|
||||
onRetry={() => handleRetry(jobId)}
|
||||
onRestartReview={() => handleRestartCdReviewFromRaw(jobId)}
|
||||
onDeleteJob={() => handleDeleteDashboardJob(jobId)}
|
||||
onOpenMetadata={() => {
|
||||
const ctx = pipelineForJob?.context && typeof pipelineForJob.context === 'object'
|
||||
? pipelineForJob.context
|
||||
@@ -2733,6 +2797,7 @@ export default function DashboardPage({
|
||||
onStart={(config) => handleAudiobookStart(jobId, config)}
|
||||
onCancel={() => handleCancel(jobId, jobState)}
|
||||
onRetry={() => handleRetry(jobId)}
|
||||
onDeleteJob={() => handleDeleteDashboardJob(jobId)}
|
||||
busy={busyJobIds.has(jobId) || needsBytes}
|
||||
/>
|
||||
</>
|
||||
@@ -2755,6 +2820,7 @@ export default function DashboardPage({
|
||||
onSelectHandBrakeTitle={handleSelectHandBrakeTitle}
|
||||
onCancel={handleCancel}
|
||||
onRetry={handleRetry}
|
||||
onDeleteJob={handleDeleteDashboardJob}
|
||||
onRemoveFromQueue={handleRemoveQueuedJob}
|
||||
isQueued={isQueued}
|
||||
busy={busyJobIds.has(jobId)}
|
||||
|
||||
Reference in New Issue
Block a user