0.14.0-4 Merger
This commit is contained in:
1 parent
caf6a638f7
commit
c27a81cdb1
127 files changed
+10643
-335
No files matched your search
@@ -24,7 +24,6 @@ import { confirmModal } from '../utils/confirmModal';
|
||||
import { isConverterJob, isSeriesVideoJob, resolveMediaType as resolveCentralMediaType } from '../utils/jobTaxonomy';
|
||||
|
||||
const processingStates = ['ANALYZING', 'RIPPING', 'MEDIAINFO_CHECK', 'ENCODING', 'CD_ANALYZING', 'CD_RIPPING', 'CD_ENCODING'];
|
||||
const driveActiveStates = ['ANALYZING', 'RIPPING', 'MEDIAINFO_CHECK', 'CD_ANALYZING', 'CD_RIPPING'];
|
||||
const activeCdDriveStates = ['CD_ANALYZING', 'CD_METADATA_SELECTION', 'CD_READY_TO_RIP', 'CD_RIPPING', 'CD_ENCODING'];
|
||||
const ripperStatuses = new Set([
|
||||
'ANALYZING',
|
||||
@@ -1008,7 +1007,6 @@ export default function RipperPage({
|
||||
const [metadataDialogVisible, setMetadataDialogVisible] = useState(false);
|
||||
const [metadataDialogContext, setMetadataDialogContext] = useState(null);
|
||||
const [metadataDialogReassignMode, setMetadataDialogReassignMode] = useState(false);
|
||||
const [duplicateJobDialog, setDuplicateJobDialog] = useState({ visible: false, existingJob: null, pendingPayload: null });
|
||||
const [cdMetadataDialogVisible, setCdMetadataDialogVisible] = useState(false);
|
||||
const [cdMetadataDialogContext, setCdMetadataDialogContext] = useState(null);
|
||||
const [cdRipPanelJobId, setCdRipPanelJobId] = useState(null);
|
||||
@@ -1131,7 +1129,10 @@ export default function RipperPage({
|
||||
if (isConverterJob(job)) {
|
||||
return false;
|
||||
}
|
||||
if (String(job?.job_kind || '').trim().toLowerCase() === 'dvd_series_container') {
|
||||
if (
|
||||
String(job?.job_kind || '').trim().toLowerCase() === 'dvd_series_container'
|
||||
|| String(job?.job_kind || '').trim().toLowerCase() === 'multipart_movie_container'
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
const normalizedStatus = String(job?.status || '').trim().toUpperCase();
|
||||
@@ -2302,6 +2303,7 @@ export default function RipperPage({
|
||||
setBusy(true);
|
||||
try {
|
||||
if (metadataDialogReassignMode) {
|
||||
const duplicateAction = String(payload?.duplicateAction || '').trim().toLowerCase();
|
||||
const providerRaw = String(payload?.metadataProvider || '').trim().toLowerCase();
|
||||
const nextWorkflowKind = String(
|
||||
payload?.workflowKind
|
||||
@@ -2309,6 +2311,12 @@ export default function RipperPage({
|
||||
|| ''
|
||||
).trim().toLowerCase();
|
||||
const reassignJob = ripperJobs.find((item) => normalizeJobId(item?.id) === normalizeJobId(payload?.jobId)) || null;
|
||||
const reassignMediaProfile = String(
|
||||
reassignJob?.media_type
|
||||
|| reassignJob?.mediaType
|
||||
|| effectiveMetadataDialogContext?.mediaProfile
|
||||
|| ''
|
||||
).trim().toLowerCase();
|
||||
const currentWorkflowKind = String(
|
||||
reassignJob?.makemkvInfo?.analyzeContext?.selectedMetadata?.workflowKind
|
||||
|| reassignJob?.makemkvInfo?.analyzeContext?.workflowKind
|
||||
@@ -2331,7 +2339,8 @@ export default function RipperPage({
|
||||
&& providerRaw
|
||||
&& currentProvider !== providerRaw
|
||||
);
|
||||
if (shouldRestartReview) {
|
||||
const forceFilmMetadataPath = ['dvd', 'bluray'].includes(reassignMediaProfile) && nextWorkflowKind === 'film';
|
||||
if (duplicateAction || shouldRestartReview || forceFilmMetadataPath) {
|
||||
await api.selectMetadata(payload);
|
||||
} else {
|
||||
await api.assignJobOmdb(payload.jobId, payload);
|
||||
@@ -2355,58 +2364,7 @@ export default function RipperPage({
|
||||
};
|
||||
|
||||
const handleMetadataSubmit = async (payload) => {
|
||||
const payloadProvider = String(payload?.metadataProvider || '').trim().toLowerCase();
|
||||
const currentJobMediaProfile = String(effectiveMetadataDialogContext?.mediaProfile || '').trim().toLowerCase();
|
||||
const isSeriesDvdPayload = payloadProvider === 'tmdb' && (currentJobMediaProfile === 'dvd' || currentJobMediaProfile === 'bluray');
|
||||
|
||||
if (metadataDialogReassignMode) {
|
||||
await doSelectMetadata(payload);
|
||||
return;
|
||||
}
|
||||
|
||||
// Serien-Discs laufen ohne Film-Duplikatdialog weiter; die Disk-Pruefung
|
||||
// erfolgt serverseitig gegen den vorhandenen Staffel-Container.
|
||||
if (isSeriesDvdPayload) {
|
||||
await doSelectMetadata(payload, { suppressErrorToast: true });
|
||||
return;
|
||||
}
|
||||
|
||||
// Duplikatprüfung: nur bei OMDB-Auswahl mit imdbId sinnvoll
|
||||
const searchTitle = payload.title || '';
|
||||
const searchImdbId = payload.imdbId || null;
|
||||
if (searchTitle) {
|
||||
try {
|
||||
const historyResponse = await api.getJobs({ search: searchTitle, limit: 50, lite: true });
|
||||
const historyJobs = Array.isArray(historyResponse?.jobs) ? historyResponse.jobs : [];
|
||||
const duplicate = historyJobs.find((job) => {
|
||||
if (normalizeJobId(job.id) === normalizeJobId(payload.jobId)) {
|
||||
return false; // aktueller Job selbst
|
||||
}
|
||||
// Gleicher Titel / imdbId?
|
||||
const titleMatch = searchImdbId
|
||||
? (job.imdb_id && job.imdb_id === searchImdbId)
|
||||
: (String(job.title || '').toLowerCase() === searchTitle.toLowerCase());
|
||||
if (!titleMatch) {
|
||||
return false;
|
||||
}
|
||||
// Gleiches Medium? Verschiedene Medien (DVD vs. Bluray) → kein Duplikat
|
||||
if (!currentJobMediaProfile || currentJobMediaProfile === 'other') {
|
||||
return false;
|
||||
}
|
||||
const jobMediaType = resolveMediaType(job);
|
||||
return jobMediaType === currentJobMediaProfile;
|
||||
});
|
||||
|
||||
if (duplicate) {
|
||||
setDuplicateJobDialog({ visible: true, existingJob: duplicate, pendingPayload: payload });
|
||||
return;
|
||||
}
|
||||
} catch (_error) {
|
||||
// Bei Fehler einfach fortfahren
|
||||
}
|
||||
}
|
||||
|
||||
await doSelectMetadata(payload);
|
||||
await doSelectMetadata(payload, { suppressErrorToast: true });
|
||||
};
|
||||
|
||||
const handleMusicBrainzSearch = async (query) => {
|
||||
@@ -2527,8 +2485,7 @@ export default function RipperPage({
|
||||
.filter((drv) => !String(drv.path || '').startsWith('__virtual__'))
|
||||
.sort((a, b) => (a.path || '').localeCompare(b.path || ''));
|
||||
}, [knownDrives, pipeline?.cdDrives, pipeline?.detectedDiscs, device, state, lastNonCdDiscEvent]);
|
||||
const isDriveActive = driveActiveStates.includes(state);
|
||||
const canRescan = !isDriveActive;
|
||||
const canRescan = !busy;
|
||||
const canOpenMetadataModal = Boolean(defaultMetadataDialogContext?.jobId);
|
||||
const queueRunningJobs = Array.isArray(queueState?.runningJobs) ? queueState.runningJobs : [];
|
||||
const queueIdleJobs = Array.isArray(queueState?.idleJobs) ? queueState.idleJobs : [];
|
||||
@@ -2813,7 +2770,7 @@ export default function RipperPage({
|
||||
severity="secondary"
|
||||
className="drive-list-action-btn"
|
||||
loading={isRescanBusy}
|
||||
disabled={isRescanBusy || isDriveActive}
|
||||
disabled={isRescanBusy}
|
||||
onClick={() => handleRescanDrive(drivePath)}
|
||||
title="Laufwerk neu lesen"
|
||||
aria-label="Laufwerk neu lesen"
|
||||
@@ -3028,6 +2985,18 @@ export default function RipperPage({
|
||||
const seriesTitleSuffix = mediaIndicator.isSeriesDvd
|
||||
? `${seriesSeasonLabel}${seriesDiscLabel}${seriesContainerLabel}`
|
||||
: '';
|
||||
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';
|
||||
const multipartDiscNumber = Number(job?.disc_number || selectedMetadata?.discNumber || 0) || null;
|
||||
const multipartContainerId = normalizeJobId(job?.parent_job_id);
|
||||
const multipartSubtitle = isMultipartMovie
|
||||
? (
|
||||
`${multipartDiscNumber ? ` Disc ${multipartDiscNumber}` : ''}`
|
||||
+ `${multipartContainerId ? ` | Container #${multipartContainerId}` : ''}`
|
||||
).trim()
|
||||
: '';
|
||||
const mediaProfile = String(pipelineForJob?.context?.mediaProfile || '').trim().toLowerCase();
|
||||
const jobState = String(pipelineForJob?.state || normalizedStatus).trim().toUpperCase();
|
||||
const pipelineStage = String(pipelineForJob?.context?.stage || '').trim().toUpperCase();
|
||||
@@ -3106,9 +3075,13 @@ export default function RipperPage({
|
||||
{mediaIndicator.isSeriesDvd ? (
|
||||
<small className="ripper-job-subtitle">{seriesTitleSuffix || '-'}</small>
|
||||
) : null}
|
||||
{!mediaIndicator.isSeriesDvd && isMultipartMovie ? (
|
||||
<small className="ripper-job-subtitle">{multipartSubtitle || 'Multipart Movie'}</small>
|
||||
) : null}
|
||||
<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}
|
||||
{isCurrentSession ? <Tag value="Aktive Session" severity="info" /> : null}
|
||||
{isResumable ? <Tag value="Fortsetzbar" severity="success" /> : null}
|
||||
{normalizedStatus === 'READY_TO_ENCODE'
|
||||
@@ -3245,6 +3218,9 @@ export default function RipperPage({
|
||||
+ (mediaIndicator.isSeriesDvd ? seriesDiscLabel : '')
|
||||
+ (mediaIndicator.isSeriesDvd ? seriesContainerLabel : '')
|
||||
+ (mediaIndicator.isSeriesDvd ? seriesTmdbLabel : '')
|
||||
+ (!mediaIndicator.isSeriesDvd && isMultipartMovie
|
||||
? `${multipartDiscNumber ? ` | Disc ${multipartDiscNumber}` : ''}${multipartContainerId ? ` | Container #${multipartContainerId}` : ''}`
|
||||
: '')
|
||||
+ (mediaIndicator.isSeriesDvd ? '' : `${job?.imdb_id ? ` | ${job.imdb_id}` : ''}`)
|
||||
))
|
||||
)}
|
||||
@@ -3253,6 +3229,7 @@ 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}
|
||||
{isCurrentSession ? <Tag value="Aktive Session" severity="info" /> : null}
|
||||
{isResumable ? <Tag value="Fortsetzbar" severity="success" /> : null}
|
||||
{normalizedStatus === 'READY_TO_ENCODE'
|
||||
@@ -3334,12 +3311,12 @@ export default function RipperPage({
|
||||
<div className="pipeline-queue-item running queue-job-item">
|
||||
<div className="pipeline-queue-item-main">
|
||||
<strong>
|
||||
#{item.jobId} | {item.title || `Job #${item.jobId}`}
|
||||
{item.title || `Job #${item.jobId}`}
|
||||
{item.hasScripts ? <i className="pi pi-code queue-job-tag" title="Skripte hinterlegt" /> : null}
|
||||
{item.hasChains ? <i className="pi pi-link queue-job-tag" title="Skriptketten hinterlegt" /> : null}
|
||||
</strong>
|
||||
{item.subtitle ? <small>{item.subtitle}</small> : null}
|
||||
<small>{getStatusLabel(item.status)}</small>
|
||||
<small>#{item.jobId} | {getStatusLabel(item.status)}</small>
|
||||
{clampedQueueProgress > 0 && (
|
||||
<ProgressBar value={clampedQueueProgress} style={{ height: '5px' }} showValue={false} />
|
||||
)}
|
||||
@@ -3451,12 +3428,12 @@ export default function RipperPage({
|
||||
) : (
|
||||
<>
|
||||
<strong>
|
||||
{item.position || '-'} | #{item.jobId} | {item.title || `Job #${item.jobId}`}
|
||||
{item.title || `Job #${item.jobId}`}
|
||||
{item.hasScripts ? <i className="pi pi-code queue-job-tag" title="Skripte hinterlegt" /> : null}
|
||||
{item.hasChains ? <i className="pi pi-link queue-job-tag" title="Skriptketten hinterlegt" /> : null}
|
||||
</strong>
|
||||
{item.subtitle ? <small>{item.subtitle}</small> : null}
|
||||
<small>{item.actionLabel || item.action || '-'} | {getStatusLabel(item.status)}</small>
|
||||
<small>{item.position || '-'} | #{item.jobId} | {item.actionLabel || item.action || '-'} | {getStatusLabel(item.status)}</small>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
@@ -3848,69 +3825,6 @@ export default function RipperPage({
|
||||
busy={busy}
|
||||
/>
|
||||
|
||||
<Dialog
|
||||
header="Titel bereits in der Historie"
|
||||
visible={duplicateJobDialog.visible}
|
||||
onHide={() => setDuplicateJobDialog({ visible: false, existingJob: null, pendingPayload: null })}
|
||||
style={{ width: '30rem', maxWidth: '96vw' }}
|
||||
modal
|
||||
>
|
||||
{(() => {
|
||||
const pendingPayload = duplicateJobDialog.pendingPayload || {};
|
||||
const metadataProvider = String(pendingPayload?.metadataProvider || '').trim().toLowerCase();
|
||||
const seasonNumber = Number(pendingPayload?.seasonNumber || 0) || 0;
|
||||
const tmdbId = Number(pendingPayload?.tmdbId || 0) || 0;
|
||||
const isSeriesContainerAssign = metadataProvider === 'tmdb' && seasonNumber > 0 && tmdbId > 0;
|
||||
return (
|
||||
<>
|
||||
<p>
|
||||
<strong>{duplicateJobDialog.existingJob?.title || duplicateJobDialog.pendingPayload?.title}</strong> ist bereits als Job #{duplicateJobDialog.existingJob?.id} in der Historie vorhanden.
|
||||
</p>
|
||||
<p>
|
||||
{isSeriesContainerAssign
|
||||
? 'Dieser Job kann dem vorhandenen Serien-Container automatisch zugewiesen werden.'
|
||||
: 'Neuen Job anlegen oder mit dem vorhandenen Eintrag weiterarbeiten?'}
|
||||
</p>
|
||||
<div className="dialog-actions">
|
||||
<Button
|
||||
label={isSeriesContainerAssign ? 'Vorhandenem Container zuweisen' : 'Vorhandenen Job öffnen'}
|
||||
icon={isSeriesContainerAssign ? 'pi pi-sitemap' : 'pi pi-history'}
|
||||
onClick={async () => {
|
||||
const payload = duplicateJobDialog.pendingPayload;
|
||||
const jobId = duplicateJobDialog.existingJob?.id;
|
||||
setDuplicateJobDialog({ visible: false, existingJob: null, pendingPayload: null });
|
||||
if (isSeriesContainerAssign) {
|
||||
await doSelectMetadata(payload);
|
||||
return;
|
||||
}
|
||||
navigate(`/history?open=${jobId}`);
|
||||
}}
|
||||
/>
|
||||
{isSeriesContainerAssign ? (
|
||||
<Button
|
||||
label="Abbrechen"
|
||||
severity="secondary"
|
||||
outlined
|
||||
onClick={() => setDuplicateJobDialog({ visible: false, existingJob: null, pendingPayload: null })}
|
||||
/>
|
||||
) : (
|
||||
<Button
|
||||
label="Neuen Job anlegen"
|
||||
severity="secondary"
|
||||
outlined
|
||||
onClick={async () => {
|
||||
const payload = duplicateJobDialog.pendingPayload;
|
||||
setDuplicateJobDialog({ visible: false, existingJob: null, pendingPayload: null });
|
||||
await doSelectMetadata(payload);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
})()}
|
||||
</Dialog>
|
||||
|
||||
<Dialog
|
||||
header={cancelCleanupDialog?.target === 'raw' ? 'Rip abgebrochen' : 'Encode abgebrochen'}
|
||||
visible={Boolean(cancelCleanupDialog.visible)}
|
||||
|
||||
Reference in new issue
Block a user