0.14.0 BluRay Series Flow
This commit is contained in:
1 parent
010c96461c
commit
9890971ff3
23 files changed
+2282
-310
No files matched your search
@@ -21,7 +21,7 @@ import otherIndicatorIcon from '../assets/media-other.svg';
|
||||
import audiobookIndicatorIcon from '../assets/media-audiobook.svg';
|
||||
import { getStatusLabel, getStatusSeverity, normalizeStatus } from '../utils/statusPresentation';
|
||||
import { confirmModal } from '../utils/confirmModal';
|
||||
import { isConverterJob, isSeriesDvdJob, resolveMediaType as resolveCentralMediaType } from '../utils/jobTaxonomy';
|
||||
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'];
|
||||
@@ -78,6 +78,32 @@ function isIncompleteRawPath(rawPath) {
|
||||
return /^incomplete_/i.test(baseName);
|
||||
}
|
||||
|
||||
function normalizePathForMatch(value) {
|
||||
return String(value || '').trim().replace(/[\\]+/g, '/');
|
||||
}
|
||||
|
||||
function isIncompleteOutputPath(outputPath) {
|
||||
const normalized = normalizePathForMatch(outputPath);
|
||||
if (!normalized) {
|
||||
return false;
|
||||
}
|
||||
return /(^|\/)incomplete_job-\d+(\/|$)/i.test(normalized);
|
||||
}
|
||||
|
||||
function getIncompleteOutputSelectionPaths(outputPath) {
|
||||
const normalized = normalizePathForMatch(outputPath);
|
||||
if (!normalized) {
|
||||
return [];
|
||||
}
|
||||
const segments = normalized.split('/').filter(Boolean);
|
||||
const incompleteIndex = segments.findIndex((segment) => /^incomplete_job-\d+$/i.test(segment));
|
||||
if (incompleteIndex < 0) {
|
||||
return [];
|
||||
}
|
||||
const folderPath = `/${segments.slice(0, incompleteIndex + 1).join('/')}`;
|
||||
return Array.from(new Set([normalized, folderPath]));
|
||||
}
|
||||
|
||||
function formatPercent(value, digits = 1) {
|
||||
const parsed = Number(value);
|
||||
if (!Number.isFinite(parsed)) {
|
||||
@@ -557,17 +583,25 @@ function resolveMediaType(job) {
|
||||
|
||||
function mediaIndicatorMeta(job) {
|
||||
const mediaType = resolveMediaType(job);
|
||||
const isSeriesDvd = mediaType === 'dvd' && isSeriesDvdJob(job);
|
||||
const isSeriesVideo = (mediaType === 'dvd' || mediaType === 'bluray') && isSeriesVideoJob(job);
|
||||
if (mediaType === 'bluray') {
|
||||
return { mediaType, src: blurayIndicatorIcon, alt: 'Blu-ray', title: 'Blu-ray' };
|
||||
return {
|
||||
mediaType,
|
||||
src: blurayIndicatorIcon,
|
||||
alt: isSeriesVideo ? 'Blu-ray Serie' : 'Blu-ray',
|
||||
title: isSeriesVideo ? 'Blu-ray Serie' : 'Blu-ray',
|
||||
isSeriesDvd: isSeriesVideo,
|
||||
isSeriesVideo
|
||||
};
|
||||
}
|
||||
if (mediaType === 'dvd') {
|
||||
return {
|
||||
mediaType,
|
||||
src: discIndicatorIcon,
|
||||
alt: isSeriesDvd ? 'DVD Serie' : 'DVD',
|
||||
title: isSeriesDvd ? 'DVD Serie' : 'DVD',
|
||||
isSeriesDvd
|
||||
alt: isSeriesVideo ? 'DVD Serie' : 'DVD',
|
||||
title: isSeriesVideo ? 'DVD Serie' : 'DVD',
|
||||
isSeriesDvd: isSeriesVideo,
|
||||
isSeriesVideo
|
||||
};
|
||||
}
|
||||
if (mediaType === 'cd') {
|
||||
@@ -1669,6 +1703,9 @@ export default function RipperPage({
|
||||
const jobId = normalizeJobId(cancelCleanupDialog?.jobId);
|
||||
const target = String(cancelCleanupDialog?.target || '').trim().toLowerCase();
|
||||
const effectiveTarget = target === 'raw' ? 'raw' : 'movie';
|
||||
const jobRow = (Array.isArray(ripperJobs) ? ripperJobs : [])
|
||||
.find((row) => normalizeJobId(row?.id) === jobId) || null;
|
||||
const includeRelated = isSeriesVideoJob(jobRow);
|
||||
if (!jobId) {
|
||||
setCancelCleanupDialog({ visible: false, jobId: null, target: null, path: null });
|
||||
return;
|
||||
@@ -1676,7 +1713,7 @@ export default function RipperPage({
|
||||
|
||||
setCancelCleanupBusy(true);
|
||||
try {
|
||||
const response = await api.deleteJobFiles(jobId, effectiveTarget);
|
||||
const response = await api.deleteJobFiles(jobId, effectiveTarget, { includeRelated });
|
||||
const summary = response?.summary || {};
|
||||
const targetSummary = effectiveTarget === 'raw'
|
||||
? (summary.raw || {})
|
||||
@@ -1956,20 +1993,48 @@ export default function RipperPage({
|
||||
const isOrphanRawImportJob = orphanImportSource === 'orphan_raw_import';
|
||||
const ripSuccessful = Number(job?.rip_successful || 0) === 1;
|
||||
const deleteIncompleteRaw = !isOrphanRawImportJob && !ripSuccessful && isIncompleteRawPath(job?.raw_path);
|
||||
const deleteTarget = deleteIncompleteRaw ? 'raw' : 'none';
|
||||
let incompleteMovieSelectionPaths = [];
|
||||
try {
|
||||
const deletePreview = await api.getJobDeletePreview(normalizedJobId, { includeRelated: true });
|
||||
const movieCandidates = Array.isArray(deletePreview?.preview?.pathCandidates?.movie)
|
||||
? deletePreview.preview.pathCandidates.movie
|
||||
: [];
|
||||
incompleteMovieSelectionPaths = Array.from(new Set(
|
||||
movieCandidates
|
||||
.filter((candidate) => Boolean(candidate?.exists) && isIncompleteOutputPath(candidate?.path))
|
||||
.map((candidate) => String(candidate?.path || '').trim())
|
||||
.filter(Boolean)
|
||||
));
|
||||
} catch (_error) {
|
||||
incompleteMovieSelectionPaths = [];
|
||||
}
|
||||
if (incompleteMovieSelectionPaths.length === 0) {
|
||||
incompleteMovieSelectionPaths = getIncompleteOutputSelectionPaths(job?.output_path);
|
||||
}
|
||||
const deleteIncompleteMovie = incompleteMovieSelectionPaths.length > 0;
|
||||
const deleteTarget = deleteIncompleteRaw && deleteIncompleteMovie
|
||||
? 'both'
|
||||
: (deleteIncompleteRaw
|
||||
? 'raw'
|
||||
: (deleteIncompleteMovie ? 'movie' : 'none'));
|
||||
const resetDriveStateOnDelete = !isOrphanRawImportJob;
|
||||
const keepDetectedDeviceOnDelete = isOrphanRawImportJob;
|
||||
const title = String(job?.title || job?.detected_title || `Job #${normalizedJobId}`).trim();
|
||||
const deleteHint = deleteIncompleteRaw && deleteIncompleteMovie
|
||||
? 'Hinweis: Unvollständiges RAW und temporärer Incomplete-Output werden gelöscht.'
|
||||
: (deleteIncompleteRaw
|
||||
? 'Hinweis: Unvollständiges RAW wird gelöscht. Für einen neuen Versuch bitte das Laufwerk erneut analysieren.'
|
||||
: (deleteIncompleteMovie
|
||||
? 'Hinweis: Temporärer Incomplete-Output wird beim Löschen mit entfernt.'
|
||||
: (isOrphanRawImportJob
|
||||
? 'Hinweis: Dieser /database-Job löscht beim Entfernen aus dem Ripper keine RAW-Dateien.'
|
||||
: 'Hinweis: Dateien bleiben erhalten. Vollständiges RAW ist anschließend über /database wiederherstellbar.')));
|
||||
const confirmed = await confirmModal({
|
||||
header: 'Job löschen',
|
||||
message:
|
||||
`Job #${normalizedJobId} wirklich löschen?\n` +
|
||||
`${title}\n\n` +
|
||||
(deleteIncompleteRaw
|
||||
? 'Hinweis: Unvollständiges RAW wird gelöscht. Für einen neuen Versuch bitte das Laufwerk erneut analysieren.'
|
||||
: (isOrphanRawImportJob
|
||||
? 'Hinweis: Dieser /database-Job löscht beim Entfernen aus dem Ripper keine RAW-Dateien.'
|
||||
: 'Hinweis: Dateien bleiben erhalten. Vollständiges RAW ist anschließend über /database wiederherstellbar.')) +
|
||||
deleteHint +
|
||||
'\nZugehörige Einträge (z.B. Serien-Container oder Folgejobs) werden ebenfalls entfernt.' +
|
||||
(isOrphanRawImportJob
|
||||
? '\nOrphan-Import-Job: Das zugeordnete Laufwerk bleibt unverändert.'
|
||||
@@ -1999,6 +2064,7 @@ export default function RipperPage({
|
||||
}
|
||||
await api.deleteJobEntry(normalizedJobId, deleteTarget, {
|
||||
includeRelated: true,
|
||||
...(deleteIncompleteMovie ? { selectedMoviePaths: incompleteMovieSelectionPaths } : {}),
|
||||
resetDriveState: resetDriveStateOnDelete,
|
||||
keepDetectedDevice: keepDetectedDeviceOnDelete,
|
||||
preserveRawForImportJobs: true
|
||||
@@ -2291,14 +2357,14 @@ 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';
|
||||
const isSeriesDvdPayload = payloadProvider === 'tmdb' && (currentJobMediaProfile === 'dvd' || currentJobMediaProfile === 'bluray');
|
||||
|
||||
if (metadataDialogReassignMode) {
|
||||
await doSelectMetadata(payload);
|
||||
return;
|
||||
}
|
||||
|
||||
// Serien-DVDs laufen ohne Film-Duplikatdialog weiter; die Disk-Pruefung
|
||||
// Serien-Discs laufen ohne Film-Duplikatdialog weiter; die Disk-Pruefung
|
||||
// erfolgt serverseitig gegen den vorhandenen Staffel-Container.
|
||||
if (isSeriesDvdPayload) {
|
||||
await doSelectMetadata(payload, { suppressErrorToast: true });
|
||||
@@ -2921,6 +2987,7 @@ export default function RipperPage({
|
||||
const pipelineForJob = pipelineByJobId.get(jobId) || pipeline;
|
||||
const jobTitle = job?.title || job?.detected_title || `Job #${jobId}`;
|
||||
const mediaIndicator = mediaIndicatorMeta(job);
|
||||
const seriesTagLabel = mediaIndicator.mediaType === 'bluray' ? 'Blu-ray Serie' : 'DVD Serie';
|
||||
const isResumable = (
|
||||
normalizedStatus === 'READY_TO_ENCODE'
|
||||
|| (mediaIndicator.mediaType === 'audiobook' && normalizedStatus === 'READY_TO_START')
|
||||
@@ -3041,7 +3108,7 @@ export default function RipperPage({
|
||||
) : null}
|
||||
<div className="ripper-job-badges">
|
||||
<Tag value={statusBadgeValue} severity={statusBadgeSeverity} />
|
||||
{mediaIndicator.isSeriesDvd ? <Tag value="DVD Serie" severity="secondary" /> : null}
|
||||
{mediaIndicator.isSeriesDvd ? <Tag value={seriesTagLabel} severity="secondary" /> : null}
|
||||
{isCurrentSession ? <Tag value="Aktive Session" severity="info" /> : null}
|
||||
{isResumable ? <Tag value="Fortsetzbar" severity="success" /> : null}
|
||||
{normalizedStatus === 'READY_TO_ENCODE'
|
||||
@@ -3185,7 +3252,7 @@ export default function RipperPage({
|
||||
</div>
|
||||
<div className="ripper-job-badges">
|
||||
<Tag value={statusBadgeValue} severity={statusBadgeSeverity} />
|
||||
{mediaIndicator.isSeriesDvd ? <Tag value="DVD Serie" severity="secondary" /> : null}
|
||||
{mediaIndicator.isSeriesDvd ? <Tag value={seriesTagLabel} 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