0.15.0 MovieMerge
This commit is contained in:
1 parent
ccd6c3ab2a
commit
06d5a45d9c
23 files changed
+3827
-176
No files matched your search
@@ -19,6 +19,7 @@ import blurayIndicatorIcon from '../assets/media-bluray.svg';
|
||||
import discIndicatorIcon from '../assets/media-disc.svg';
|
||||
import otherIndicatorIcon from '../assets/media-other.svg';
|
||||
import audiobookIndicatorIcon from '../assets/media-audiobook.svg';
|
||||
import mergeIndicatorIcon from '../assets/media-merge.svg';
|
||||
import { getStatusLabel, getStatusSeverity, normalizeStatus } from '../utils/statusPresentation';
|
||||
import { confirmModal } from '../utils/confirmModal';
|
||||
import { isConverterJob, isSeriesVideoJob, resolveMediaType as resolveCentralMediaType } from '../utils/jobTaxonomy';
|
||||
@@ -517,6 +518,125 @@ function getAnalyzeContext(job) {
|
||||
: {};
|
||||
}
|
||||
|
||||
function getEncodePlan(job) {
|
||||
if (job?.encodePlan && typeof job.encodePlan === 'object') {
|
||||
return job.encodePlan;
|
||||
}
|
||||
if (job?.encode_plan_json && typeof job.encode_plan_json === 'object') {
|
||||
return job.encode_plan_json;
|
||||
}
|
||||
const rawPlan = String(job?.encode_plan_json || '').trim();
|
||||
if (!rawPlan) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const parsed = JSON.parse(rawPlan);
|
||||
return parsed && typeof parsed === 'object' ? parsed : null;
|
||||
} catch (_error) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function resolveJobKindRaw(job) {
|
||||
return String(job?.job_kind || job?.jobKind || '').trim().toLowerCase();
|
||||
}
|
||||
|
||||
function isMultipartMergeJob(job) {
|
||||
return resolveJobKindRaw(job) === 'multipart_movie_merge';
|
||||
}
|
||||
|
||||
function extractMultipartMergeSources(job) {
|
||||
const encodePlan = getEncodePlan(job) || {};
|
||||
const sourceItems = Array.isArray(encodePlan?.sourceItems) ? encodePlan.sourceItems : [];
|
||||
const normalized = sourceItems
|
||||
.map((item) => {
|
||||
const sourceJobId = normalizeJobId(item?.jobId || item?.sourceJobId);
|
||||
const discNumberRaw = Number(item?.discNumber);
|
||||
const discNumber = Number.isFinite(discNumberRaw) && discNumberRaw > 0
|
||||
? Math.trunc(discNumberRaw)
|
||||
: null;
|
||||
const outputPath = String(item?.outputPath || item?.path || '').trim();
|
||||
if (!sourceJobId || !outputPath) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
sourceJobId,
|
||||
discNumber,
|
||||
outputPath,
|
||||
fileName: getPathBaseName(outputPath)
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
if (normalized.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const orderedIds = Array.isArray(encodePlan?.orderedSourceJobIds)
|
||||
? encodePlan.orderedSourceJobIds.map((value) => normalizeJobId(value)).filter(Boolean)
|
||||
: [];
|
||||
const byId = new Map(normalized.map((item) => [item.sourceJobId, item]));
|
||||
const ordered = [];
|
||||
const seen = new Set();
|
||||
for (const sourceJobId of orderedIds) {
|
||||
const item = byId.get(sourceJobId);
|
||||
if (!item || seen.has(sourceJobId)) {
|
||||
continue;
|
||||
}
|
||||
seen.add(sourceJobId);
|
||||
ordered.push(item);
|
||||
}
|
||||
for (const item of normalized) {
|
||||
if (seen.has(item.sourceJobId)) {
|
||||
continue;
|
||||
}
|
||||
seen.add(item.sourceJobId);
|
||||
ordered.push(item);
|
||||
}
|
||||
return ordered;
|
||||
}
|
||||
|
||||
function formatMergeTrackLanguage(language) {
|
||||
const normalized = String(language || '').trim().toLowerCase();
|
||||
if (!normalized || normalized === 'und') {
|
||||
return 'und';
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
function formatMergeTrackSummary(track = {}, fallbackLabel = 'Track') {
|
||||
const source = track && typeof track === 'object' ? track : {};
|
||||
const orderRaw = Number(source.order);
|
||||
const order = Number.isFinite(orderRaw) && orderRaw > 0 ? Math.trunc(orderRaw) : null;
|
||||
const language = formatMergeTrackLanguage(source.language);
|
||||
const codec = String(source.codec || '?').trim() || '?';
|
||||
const title = String(source.title || '').trim();
|
||||
const channelsRaw = Number(source.channels);
|
||||
const channelInfo = Number.isFinite(channelsRaw) && channelsRaw > 0
|
||||
? `${Math.trunc(channelsRaw)}ch`
|
||||
: null;
|
||||
const flags = [];
|
||||
if (source.default === true) {
|
||||
flags.push('default');
|
||||
}
|
||||
if (source.forced === true) {
|
||||
flags.push('forced');
|
||||
}
|
||||
const parts = [
|
||||
order ? `#${order}` : fallbackLabel,
|
||||
language,
|
||||
codec
|
||||
];
|
||||
if (channelInfo) {
|
||||
parts.push(channelInfo);
|
||||
}
|
||||
if (title) {
|
||||
parts.push(title);
|
||||
}
|
||||
if (flags.length > 0) {
|
||||
parts.push(`[${flags.join(', ')}]`);
|
||||
}
|
||||
return parts.join(' | ');
|
||||
}
|
||||
|
||||
function resolveMediaType(job) {
|
||||
const centralMediaType = resolveCentralMediaType(job);
|
||||
if (centralMediaType && centralMediaType !== 'other') {
|
||||
@@ -581,6 +701,14 @@ function resolveMediaType(job) {
|
||||
}
|
||||
|
||||
function mediaIndicatorMeta(job) {
|
||||
if (isMultipartMergeJob(job)) {
|
||||
return {
|
||||
mediaType: 'multipart_merge',
|
||||
src: mergeIndicatorIcon,
|
||||
alt: 'Merge Job',
|
||||
title: 'Multipart Merge Job'
|
||||
};
|
||||
}
|
||||
const mediaType = resolveMediaType(job);
|
||||
const isSeriesVideo = (mediaType === 'dvd' || mediaType === 'bluray') && isSeriesVideoJob(job);
|
||||
if (mediaType === 'bluray') {
|
||||
@@ -1020,6 +1148,7 @@ export default function RipperPage({
|
||||
const [queueState, setQueueState] = useState(() => normalizeQueue(pipeline?.queue));
|
||||
const [queueReorderBusy, setQueueReorderBusy] = useState(false);
|
||||
const [draggingQueueEntryId, setDraggingQueueEntryId] = useState(null);
|
||||
const [draggingMergeSource, setDraggingMergeSource] = useState(null);
|
||||
const [insertQueueDialog, setInsertQueueDialog] = useState({ visible: false, afterEntryId: null });
|
||||
const [runtimeActivities, setRuntimeActivities] = useState(() => normalizeRuntimeActivitiesPayload(null));
|
||||
const [runtimeLoading, setRuntimeLoading] = useState(false);
|
||||
@@ -1027,6 +1156,8 @@ export default function RipperPage({
|
||||
const [runtimeRecentClearing, setRuntimeRecentClearing] = useState(false);
|
||||
const [jobsLoading, setJobsLoading] = useState(false);
|
||||
const [ripperJobs, setRipperJobs] = useState([]);
|
||||
const [multipartMergePreviewByJobId, setMultipartMergePreviewByJobId] = useState({});
|
||||
const [multipartMergePreviewLoadingByJobId, setMultipartMergePreviewLoadingByJobId] = useState({});
|
||||
const [expandedJobId, setExpandedJobId] = useState(undefined);
|
||||
const [activationBytesDialog, setActivationBytesDialog] = useState({ visible: false, checksum: null, jobId: null });
|
||||
const [activationBytesInput, setActivationBytesInput] = useState('');
|
||||
@@ -1363,6 +1494,18 @@ export default function RipperPage({
|
||||
setExpandedJobId(normalizeJobId(ripperJobs[0]?.id));
|
||||
}, [ripperJobs, expandedJobId, currentPipelineJobId]);
|
||||
|
||||
useEffect(() => {
|
||||
const normalizedExpanded = normalizeJobId(expandedJobId);
|
||||
if (!normalizedExpanded) {
|
||||
return;
|
||||
}
|
||||
const expandedJob = ripperJobs.find((job) => normalizeJobId(job?.id) === normalizedExpanded) || null;
|
||||
if (!expandedJob || !isMultipartMergeJob(expandedJob)) {
|
||||
return;
|
||||
}
|
||||
void loadMultipartMergePreview(normalizedExpanded, { force: false, silent: true });
|
||||
}, [expandedJobId, ripperJobs]);
|
||||
|
||||
const pipelineByJobId = useMemo(() => {
|
||||
const map = new Map();
|
||||
for (const job of ripperJobs) {
|
||||
@@ -1463,6 +1606,49 @@ export default function RipperPage({
|
||||
});
|
||||
};
|
||||
|
||||
const loadMultipartMergePreview = async (jobId, options = {}) => {
|
||||
const normalizedJobId = normalizeJobId(jobId);
|
||||
if (!normalizedJobId) {
|
||||
return null;
|
||||
}
|
||||
const force = options?.force === true;
|
||||
const silent = options?.silent !== false;
|
||||
if (!force) {
|
||||
const existingPreview = multipartMergePreviewByJobId[normalizedJobId];
|
||||
if (existingPreview) {
|
||||
return existingPreview;
|
||||
}
|
||||
}
|
||||
if (!force && multipartMergePreviewLoadingByJobId[normalizedJobId]) {
|
||||
return null;
|
||||
}
|
||||
setMultipartMergePreviewLoadingByJobId((prev) => ({
|
||||
...prev,
|
||||
[normalizedJobId]: true
|
||||
}));
|
||||
try {
|
||||
const response = await api.getMultipartMergePreview(normalizedJobId);
|
||||
const preview = response?.preview && typeof response.preview === 'object'
|
||||
? response.preview
|
||||
: null;
|
||||
setMultipartMergePreviewByJobId((prev) => ({
|
||||
...prev,
|
||||
[normalizedJobId]: preview
|
||||
}));
|
||||
return preview;
|
||||
} catch (error) {
|
||||
if (!silent) {
|
||||
showError(error);
|
||||
}
|
||||
return null;
|
||||
} finally {
|
||||
setMultipartMergePreviewLoadingByJobId((prev) => ({
|
||||
...prev,
|
||||
[normalizedJobId]: false
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
const handleOpenMetadataDialog = (jobId = null) => {
|
||||
const context = jobId ? buildMetadataContextForJob(jobId) : defaultMetadataDialogContext;
|
||||
if (!context?.jobId) {
|
||||
@@ -1805,6 +1991,31 @@ export default function RipperPage({
|
||||
}
|
||||
};
|
||||
|
||||
const handleReorderMultipartMergeSources = async (jobId, orderedSourceJobIds = []) => {
|
||||
const normalizedJobId = normalizeJobId(jobId);
|
||||
if (!normalizedJobId) {
|
||||
return;
|
||||
}
|
||||
const normalizedOrderedIds = Array.isArray(orderedSourceJobIds)
|
||||
? orderedSourceJobIds.map((value) => normalizeJobId(value)).filter(Boolean)
|
||||
: [];
|
||||
if (normalizedOrderedIds.length < 2) {
|
||||
return;
|
||||
}
|
||||
setJobBusy(normalizedJobId, true);
|
||||
try {
|
||||
await api.reorderMultipartMergeSources(normalizedJobId, normalizedOrderedIds);
|
||||
await refreshPipeline();
|
||||
await loadRipperJobs();
|
||||
await loadMultipartMergePreview(normalizedJobId, { force: true, silent: true });
|
||||
setExpandedJobId(normalizedJobId);
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
} finally {
|
||||
setJobBusy(normalizedJobId, false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleSaveActivationBytes = async () => {
|
||||
const { checksum, jobId } = activationBytesDialog;
|
||||
const bytes = activationBytesInput.trim().toLowerCase();
|
||||
@@ -1992,11 +2203,16 @@ export default function RipperPage({
|
||||
|| ''
|
||||
).trim().toLowerCase();
|
||||
const isOrphanRawImportJob = orphanImportSource === 'orphan_raw_import';
|
||||
const jobKindRaw = String(job?.job_kind || '').trim().toLowerCase();
|
||||
const isMultipartChildJob = jobKindRaw === 'multipart_movie_child'
|
||||
|| jobKindRaw === 'multipart_movie_merge'
|
||||
|| (Number(job?.is_multipart_movie || 0) === 1 && Boolean(normalizeJobId(job?.parent_job_id)));
|
||||
const includeRelatedOnDelete = !isMultipartChildJob;
|
||||
const ripSuccessful = Number(job?.rip_successful || 0) === 1;
|
||||
const deleteIncompleteRaw = !isOrphanRawImportJob && !ripSuccessful && isIncompleteRawPath(job?.raw_path);
|
||||
let incompleteMovieSelectionPaths = [];
|
||||
try {
|
||||
const deletePreview = await api.getJobDeletePreview(normalizedJobId, { includeRelated: true });
|
||||
const deletePreview = await api.getJobDeletePreview(normalizedJobId, { includeRelated: includeRelatedOnDelete });
|
||||
const movieCandidates = Array.isArray(deletePreview?.preview?.pathCandidates?.movie)
|
||||
? deletePreview.preview.pathCandidates.movie
|
||||
: [];
|
||||
@@ -2036,7 +2252,9 @@ export default function RipperPage({
|
||||
`Job #${normalizedJobId} wirklich löschen?\n` +
|
||||
`${title}\n\n` +
|
||||
deleteHint +
|
||||
'\nZugehörige Einträge (z.B. Serien-Container oder Folgejobs) werden ebenfalls entfernt.' +
|
||||
(includeRelatedOnDelete
|
||||
? '\nZugehörige Einträge (z.B. Serien-Container oder Folgejobs) werden ebenfalls entfernt.'
|
||||
: '\nEs wird nur dieser Job entfernt; andere zugehörige Disks bleiben erhalten.') +
|
||||
(isOrphanRawImportJob
|
||||
? '\nOrphan-Import-Job: Das zugeordnete Laufwerk bleibt unverändert.'
|
||||
: '\nDas zugeordnete Laufwerk wird freigegeben und auf Leerzustand zurückgesetzt.'),
|
||||
@@ -2064,7 +2282,7 @@ export default function RipperPage({
|
||||
}
|
||||
}
|
||||
await api.deleteJobEntry(normalizedJobId, deleteTarget, {
|
||||
includeRelated: true,
|
||||
includeRelated: includeRelatedOnDelete,
|
||||
...(deleteIncompleteMovie ? { selectedMoviePaths: incompleteMovieSelectionPaths } : {}),
|
||||
resetDriveState: resetDriveStateOnDelete,
|
||||
keepDetectedDevice: keepDetectedDeviceOnDelete,
|
||||
@@ -2988,12 +3206,14 @@ export default function RipperPage({
|
||||
const jobKindRaw = String(job?.job_kind || '').trim().toLowerCase();
|
||||
const isMultipartMovie = Number(job?.is_multipart_movie || 0) === 1
|
||||
|| jobKindRaw === 'multipart_movie_child'
|
||||
|| jobKindRaw === 'multipart_movie_container';
|
||||
|| jobKindRaw === 'multipart_movie_container'
|
||||
|| jobKindRaw === 'multipart_movie_merge';
|
||||
const isMultipartMerge = isMultipartMergeJob(job);
|
||||
const multipartDiscNumber = Number(job?.disc_number || selectedMetadata?.discNumber || 0) || null;
|
||||
const multipartContainerId = normalizeJobId(job?.parent_job_id);
|
||||
const multipartSubtitle = isMultipartMovie
|
||||
? (
|
||||
`${multipartDiscNumber ? ` Disc ${multipartDiscNumber}` : ''}`
|
||||
`${isMultipartMerge ? ' Merge' : `${multipartDiscNumber ? ` Disc ${multipartDiscNumber}` : ''}`}`
|
||||
+ `${multipartContainerId ? ` | Container #${multipartContainerId}` : ''}`
|
||||
).trim()
|
||||
: '';
|
||||
@@ -3053,6 +3273,28 @@ export default function RipperPage({
|
||||
? pipelineForJob.context.selectedMetadata
|
||||
: {};
|
||||
const audiobookChapterCount = Array.isArray(audiobookMeta?.chapters) ? audiobookMeta.chapters.length : 0;
|
||||
const multipartMergeSources = isMultipartMerge ? extractMultipartMergeSources(job) : [];
|
||||
const hasMultipartMergeSources = multipartMergeSources.length > 0;
|
||||
const multipartMergePreview = isMultipartMerge
|
||||
? (multipartMergePreviewByJobId[jobId] || null)
|
||||
: null;
|
||||
const multipartMergePreviewLoading = Boolean(
|
||||
isMultipartMerge && multipartMergePreviewLoadingByJobId[jobId]
|
||||
);
|
||||
const multipartMergeCommandPreview = String(multipartMergePreview?.command?.preview || '').trim();
|
||||
const multipartMergeChapterEntries = Array.isArray(multipartMergePreview?.chapters?.entries)
|
||||
? multipartMergePreview.chapters.entries
|
||||
: [];
|
||||
const multipartMergeAudioTracks = Array.isArray(multipartMergePreview?.media?.audioTracks)
|
||||
? multipartMergePreview.media.audioTracks
|
||||
: [];
|
||||
const multipartMergeSubtitleTracks = Array.isArray(multipartMergePreview?.media?.subtitleTracks)
|
||||
? multipartMergePreview.media.subtitleTracks
|
||||
: [];
|
||||
const multipartMergeMediaAligned = Boolean(multipartMergePreview?.media?.allSourcesAligned);
|
||||
const multipartMergeMediaMismatchCount = Array.isArray(multipartMergePreview?.media?.mismatches)
|
||||
? multipartMergePreview.media.mismatches.length
|
||||
: 0;
|
||||
if (isExpanded) {
|
||||
return (
|
||||
<div key={jobId} className="ripper-job-expanded">
|
||||
@@ -3081,7 +3323,8 @@ export default function RipperPage({
|
||||
<div className="ripper-job-badges">
|
||||
<Tag value={statusBadgeValue} severity={statusBadgeSeverity} />
|
||||
{mediaIndicator.isSeriesDvd ? <Tag value={seriesTagLabel} severity="secondary" /> : null}
|
||||
{isMultipartMovie ? <Tag value="Multipart Movie" severity="secondary" /> : null}
|
||||
{isMultipartMerge ? <Tag value="Merge Job" severity="warning" /> : null}
|
||||
{!isMultipartMerge && isMultipartMovie ? <Tag value="Multipart Movie" severity="secondary" /> : null}
|
||||
{isCurrentSession ? <Tag value="Aktive Session" severity="info" /> : null}
|
||||
{isResumable ? <Tag value="Fortsetzbar" severity="success" /> : null}
|
||||
{normalizedStatus === 'READY_TO_ENCODE'
|
||||
@@ -3151,28 +3394,221 @@ export default function RipperPage({
|
||||
return null;
|
||||
})()}
|
||||
{!isCdJob && !isAudiobookJob ? (
|
||||
<PipelineStatusCard
|
||||
jobId={jobId}
|
||||
jobRow={job}
|
||||
pipeline={pipelineForJob}
|
||||
onAnalyze={handleAnalyze}
|
||||
onReanalyze={handleReanalyze}
|
||||
onOpenMetadata={handleOpenMetadataDialog}
|
||||
onReassignOmdb={handleOpenReassignOmdbDialog}
|
||||
onStart={handleStartJob}
|
||||
onRestartEncode={handleRestartEncodeWithLastSettings}
|
||||
onRestartReview={handleRestartReviewFromRaw}
|
||||
onConfirmReview={handleConfirmReview}
|
||||
onSelectPlaylist={handleSelectPlaylist}
|
||||
onSelectHandBrakeTitle={handleSelectHandBrakeTitle}
|
||||
onSubmitRawDecision={handleSubmitRawDecision}
|
||||
onCancel={handleCancel}
|
||||
onRetry={handleRetry}
|
||||
onDeleteJob={handleDeleteRipperJob}
|
||||
onRemoveFromQueue={handleRemoveQueuedJob}
|
||||
isQueued={isQueued}
|
||||
busy={busyJobIds.has(jobId)}
|
||||
/>
|
||||
isMultipartMerge ? (
|
||||
<div className="multipart-merge-panel">
|
||||
<div className="multipart-merge-head">
|
||||
<strong>Merge-Quellen</strong>
|
||||
<small>Drag-and-Drop ändert die Reihenfolge der Disc-Dateien.</small>
|
||||
</div>
|
||||
{hasMultipartMergeSources ? (
|
||||
<div className="multipart-merge-list">
|
||||
{multipartMergeSources.map((source, sourceIndex) => {
|
||||
const sourceKey = `${jobId}-${source.sourceJobId}-${sourceIndex}`;
|
||||
const canReorder = !busyJobIds.has(jobId)
|
||||
&& !processingStates.includes(normalizedStatus)
|
||||
&& multipartMergeSources.length > 1;
|
||||
return (
|
||||
<div
|
||||
key={sourceKey}
|
||||
className="multipart-merge-item"
|
||||
draggable={canReorder}
|
||||
onDragStart={() => {
|
||||
if (!canReorder) return;
|
||||
setDraggingMergeSource({ jobId, sourceJobId: source.sourceJobId });
|
||||
}}
|
||||
onDragEnd={() => setDraggingMergeSource(null)}
|
||||
onDragOver={(event) => {
|
||||
if (!canReorder) return;
|
||||
if (!draggingMergeSource || draggingMergeSource.jobId !== jobId) return;
|
||||
event.preventDefault();
|
||||
}}
|
||||
onDrop={(event) => {
|
||||
if (!canReorder) return;
|
||||
if (!draggingMergeSource || draggingMergeSource.jobId !== jobId) return;
|
||||
event.preventDefault();
|
||||
const draggedId = normalizeJobId(draggingMergeSource.sourceJobId);
|
||||
const targetId = normalizeJobId(source.sourceJobId);
|
||||
if (!draggedId || !targetId || draggedId === targetId) {
|
||||
setDraggingMergeSource(null);
|
||||
return;
|
||||
}
|
||||
const currentOrder = multipartMergeSources
|
||||
.map((item) => normalizeJobId(item.sourceJobId))
|
||||
.filter(Boolean);
|
||||
const fromIndex = currentOrder.findIndex((id) => id === draggedId);
|
||||
const toIndex = currentOrder.findIndex((id) => id === targetId);
|
||||
if (fromIndex < 0 || toIndex < 0 || fromIndex === toIndex) {
|
||||
setDraggingMergeSource(null);
|
||||
return;
|
||||
}
|
||||
const nextOrder = [...currentOrder];
|
||||
const [moved] = nextOrder.splice(fromIndex, 1);
|
||||
nextOrder.splice(toIndex, 0, moved);
|
||||
setDraggingMergeSource(null);
|
||||
handleReorderMultipartMergeSources(jobId, nextOrder);
|
||||
}}
|
||||
>
|
||||
<div className="multipart-merge-item-meta">
|
||||
<Tag value={`#${sourceIndex + 1}`} severity="contrast" />
|
||||
<Tag value={source.discNumber ? `Disc ${source.discNumber}` : 'Disc ?'} severity="info" />
|
||||
<Tag value={`Job #${source.sourceJobId}`} severity="secondary" />
|
||||
</div>
|
||||
<div className="multipart-merge-item-text">
|
||||
<strong>{source.fileName || source.outputPath}</strong>
|
||||
<small>{source.outputPath}</small>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
) : (
|
||||
<p className="muted-inline">Noch keine Merge-Quellen gefunden.</p>
|
||||
)}
|
||||
<div className="multipart-merge-preview">
|
||||
<div className="multipart-merge-preview-head">
|
||||
<strong>Merge Vorschau</strong>
|
||||
<Button
|
||||
icon="pi pi-refresh"
|
||||
text
|
||||
severity="secondary"
|
||||
aria-label="Merge-Vorschau aktualisieren"
|
||||
onClick={() => loadMultipartMergePreview(jobId, { force: true, silent: false })}
|
||||
disabled={busyJobIds.has(jobId) || multipartMergePreviewLoading}
|
||||
/>
|
||||
</div>
|
||||
{multipartMergePreviewLoading ? (
|
||||
<small className="muted-inline">Vorschau wird aktualisiert ...</small>
|
||||
) : null}
|
||||
<div className="multipart-merge-preview-section">
|
||||
<strong>1. CLI-Befehl</strong>
|
||||
{multipartMergeCommandPreview ? (
|
||||
<code className="multipart-merge-command-preview">{multipartMergeCommandPreview}</code>
|
||||
) : (
|
||||
<small className="muted-inline">Noch keine Vorschau verfügbar.</small>
|
||||
)}
|
||||
</div>
|
||||
<div className="multipart-merge-preview-section">
|
||||
<strong>2. Kapitel (gesamt)</strong>
|
||||
{multipartMergeChapterEntries.length > 0 ? (
|
||||
<div className="multipart-merge-chapter-list">
|
||||
{multipartMergeChapterEntries.map((entry) => (
|
||||
<div key={`merge-chapter-${jobId}-${entry.index}`} className="multipart-merge-chapter-item">
|
||||
<small>#{entry.index}</small>
|
||||
<small>{entry.startClock || entry.start || '-'}</small>
|
||||
<span>{entry.title || '-'}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<small className="muted-inline">Keine berechnete Kapitel-Gesamtliste verfügbar.</small>
|
||||
)}
|
||||
</div>
|
||||
<div className="multipart-merge-preview-section">
|
||||
<strong>3. Erwartete Medieninfos (nach Merge)</strong>
|
||||
<div className="multipart-merge-track-columns">
|
||||
<div className="multipart-merge-track-column">
|
||||
<small className="multipart-merge-track-heading">Audio</small>
|
||||
{multipartMergeAudioTracks.length > 0 ? (
|
||||
<div className="multipart-merge-track-list">
|
||||
{multipartMergeAudioTracks.map((track) => (
|
||||
<small key={`merge-audio-${jobId}-${track.order || track.streamIndex}`}>
|
||||
{formatMergeTrackSummary(track, 'Audio')}
|
||||
</small>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<small className="muted-inline">Keine Audio-Infos.</small>
|
||||
)}
|
||||
</div>
|
||||
<div className="multipart-merge-track-column">
|
||||
<small className="multipart-merge-track-heading">Untertitel</small>
|
||||
{multipartMergeSubtitleTracks.length > 0 ? (
|
||||
<div className="multipart-merge-track-list">
|
||||
{multipartMergeSubtitleTracks.map((track) => (
|
||||
<small key={`merge-sub-${jobId}-${track.order || track.streamIndex}`}>
|
||||
{formatMergeTrackSummary(track, 'UT')}
|
||||
</small>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<small className="muted-inline">Keine Untertitel-Infos.</small>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{multipartMergePreview?.media?.available ? (
|
||||
<small className={multipartMergeMediaAligned ? 'muted-inline' : 'error-text'}>
|
||||
{multipartMergeMediaAligned
|
||||
? 'Track-Layout über alle Quellen konsistent.'
|
||||
: `Achtung: Track-Layout unterscheidet sich zwischen Quellen (${multipartMergeMediaMismatchCount} Abweichung(en)).`}
|
||||
</small>
|
||||
) : (
|
||||
<small className="muted-inline">Stream-Vergleich noch nicht verfügbar.</small>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="multipart-merge-actions">
|
||||
{(normalizedStatus === 'READY_TO_START' || normalizedStatus === 'READY_TO_ENCODE') ? (
|
||||
<Button
|
||||
label={isQueued ? 'In Queue' : 'Merge starten'}
|
||||
icon="pi pi-play"
|
||||
onClick={() => handleStartJob(jobId)}
|
||||
disabled={busyJobIds.has(jobId) || isQueued}
|
||||
/>
|
||||
) : null}
|
||||
{processingStates.includes(normalizedStatus) ? (
|
||||
<Button
|
||||
label="Abbrechen"
|
||||
icon="pi pi-stop"
|
||||
severity="warning"
|
||||
outlined
|
||||
onClick={() => handleCancel(jobId, jobState)}
|
||||
disabled={busyJobIds.has(jobId)}
|
||||
/>
|
||||
) : null}
|
||||
{(normalizedStatus === 'ERROR' || normalizedStatus === 'CANCELLED') ? (
|
||||
<Button
|
||||
label="Retry"
|
||||
icon="pi pi-refresh"
|
||||
severity="secondary"
|
||||
outlined
|
||||
onClick={() => handleRetry(jobId)}
|
||||
disabled={busyJobIds.has(jobId)}
|
||||
/>
|
||||
) : null}
|
||||
<Button
|
||||
label="Job löschen"
|
||||
icon="pi pi-trash"
|
||||
severity="danger"
|
||||
outlined
|
||||
onClick={() => handleDeleteRipperJob(jobId)}
|
||||
disabled={busyJobIds.has(jobId)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<PipelineStatusCard
|
||||
jobId={jobId}
|
||||
jobRow={job}
|
||||
pipeline={pipelineForJob}
|
||||
onAnalyze={handleAnalyze}
|
||||
onReanalyze={handleReanalyze}
|
||||
onOpenMetadata={handleOpenMetadataDialog}
|
||||
onReassignOmdb={handleOpenReassignOmdbDialog}
|
||||
onStart={handleStartJob}
|
||||
onRestartEncode={handleRestartEncodeWithLastSettings}
|
||||
onRestartReview={handleRestartReviewFromRaw}
|
||||
onConfirmReview={handleConfirmReview}
|
||||
onSelectPlaylist={handleSelectPlaylist}
|
||||
onSelectHandBrakeTitle={handleSelectHandBrakeTitle}
|
||||
onSubmitRawDecision={handleSubmitRawDecision}
|
||||
onCancel={handleCancel}
|
||||
onRetry={handleRetry}
|
||||
onDeleteJob={handleDeleteRipperJob}
|
||||
onRemoveFromQueue={handleRemoveQueuedJob}
|
||||
isQueued={isQueued}
|
||||
busy={busyJobIds.has(jobId)}
|
||||
/>
|
||||
)
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
@@ -3219,7 +3655,7 @@ export default function RipperPage({
|
||||
+ (mediaIndicator.isSeriesDvd ? seriesContainerLabel : '')
|
||||
+ (mediaIndicator.isSeriesDvd ? seriesTmdbLabel : '')
|
||||
+ (!mediaIndicator.isSeriesDvd && isMultipartMovie
|
||||
? `${multipartDiscNumber ? ` | Disc ${multipartDiscNumber}` : ''}${multipartContainerId ? ` | Container #${multipartContainerId}` : ''}`
|
||||
? `${isMultipartMerge ? ' | Merge' : ''}${multipartDiscNumber ? ` | Disc ${multipartDiscNumber}` : ''}${multipartContainerId ? ` | Container #${multipartContainerId}` : ''}`
|
||||
: '')
|
||||
+ (mediaIndicator.isSeriesDvd ? '' : `${job?.imdb_id ? ` | ${job.imdb_id}` : ''}`)
|
||||
))
|
||||
@@ -3229,7 +3665,8 @@ export default function RipperPage({
|
||||
<div className="ripper-job-badges">
|
||||
<Tag value={statusBadgeValue} severity={statusBadgeSeverity} />
|
||||
{mediaIndicator.isSeriesDvd ? <Tag value={seriesTagLabel} severity="secondary" /> : null}
|
||||
{isMultipartMovie ? <Tag value="Multipart Movie" severity="secondary" /> : null}
|
||||
{isMultipartMerge ? <Tag value="Merge Job" severity="warning" /> : null}
|
||||
{!isMultipartMerge && isMultipartMovie ? <Tag value="Multipart Movie" severity="secondary" /> : null}
|
||||
{isCurrentSession ? <Tag value="Aktive Session" severity="info" /> : null}
|
||||
{isResumable ? <Tag value="Fortsetzbar" severity="success" /> : null}
|
||||
{normalizedStatus === 'READY_TO_ENCODE'
|
||||
|
||||
Reference in new issue
Block a user