0.16.0 Pre-Release Checks
This commit is contained in:
1 parent
ff8a8f67bf
commit
d679eface4
23 files changed
+2372
-301
No files matched your search
@@ -771,6 +771,86 @@ function mediaIndicatorMeta(job) {
|
||||
return { mediaType, src: otherIndicatorIcon, alt: 'Sonstiges Medium', title: 'Sonstiges Medium' };
|
||||
}
|
||||
|
||||
function normalizeDiscWorkflowKind(value) {
|
||||
const raw = String(value || '').trim().toLowerCase();
|
||||
if (!raw) {
|
||||
return null;
|
||||
}
|
||||
if (['series', 'tv', 'season', 'episode', 'tv_series', 'tv-season', 'tv_season'].includes(raw)) {
|
||||
return 'series';
|
||||
}
|
||||
if (['film', 'movie', 'feature'].includes(raw)) {
|
||||
return 'film';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function resolveDiscWorkflowKind({
|
||||
mediaType,
|
||||
selectedMetadata = null,
|
||||
analyzeContext = null,
|
||||
pipelineContext = null,
|
||||
fallbackIsSeries = false
|
||||
} = {}) {
|
||||
if (mediaType !== 'dvd' && mediaType !== 'bluray') {
|
||||
return null;
|
||||
}
|
||||
const selected = selectedMetadata && typeof selectedMetadata === 'object' ? selectedMetadata : {};
|
||||
const analyze = analyzeContext && typeof analyzeContext === 'object' ? analyzeContext : {};
|
||||
const pipelineCtx = pipelineContext && typeof pipelineContext === 'object' ? pipelineContext : {};
|
||||
const workflowCandidates = [
|
||||
selected?.workflowKind,
|
||||
selected?.kind,
|
||||
analyze?.workflowKind,
|
||||
pipelineCtx?.workflowKind
|
||||
];
|
||||
for (const candidate of workflowCandidates) {
|
||||
const normalized = normalizeDiscWorkflowKind(candidate);
|
||||
if (normalized) {
|
||||
return normalized;
|
||||
}
|
||||
}
|
||||
const metadataKindCandidates = [
|
||||
selected?.metadataKind,
|
||||
analyze?.metadataKind
|
||||
];
|
||||
for (const candidate of metadataKindCandidates) {
|
||||
const normalized = normalizeDiscWorkflowKind(candidate);
|
||||
if (normalized) {
|
||||
return normalized;
|
||||
}
|
||||
}
|
||||
const providerCandidates = [
|
||||
selected?.metadataProvider,
|
||||
analyze?.metadataProvider,
|
||||
pipelineCtx?.metadataProvider
|
||||
];
|
||||
for (const candidate of providerCandidates) {
|
||||
const provider = String(candidate || '').trim().toLowerCase();
|
||||
if (!provider) {
|
||||
continue;
|
||||
}
|
||||
if (provider === 'tmdb' || provider === 'themoviedb') {
|
||||
return 'series';
|
||||
}
|
||||
if (provider === 'omdb') {
|
||||
return 'film';
|
||||
}
|
||||
}
|
||||
return fallbackIsSeries ? 'series' : 'film';
|
||||
}
|
||||
|
||||
function getDiscWorkflowBadgeLabel(mediaType, workflowKind) {
|
||||
if (mediaType !== 'dvd' && mediaType !== 'bluray') {
|
||||
return null;
|
||||
}
|
||||
const kind = normalizeDiscWorkflowKind(workflowKind) || 'film';
|
||||
if (mediaType === 'bluray') {
|
||||
return kind === 'series' ? 'Blu-ray-Serie' : 'Blu-ray-Film';
|
||||
}
|
||||
return kind === 'series' ? 'DVD-Serie' : 'DVD-Film';
|
||||
}
|
||||
|
||||
function JobStepChecks({ backupSuccess, encodeSuccess }) {
|
||||
const hasAny = Boolean(backupSuccess || encodeSuccess);
|
||||
if (!hasAny) {
|
||||
@@ -2308,6 +2388,20 @@ export default function RipperPage({
|
||||
|
||||
const handleRetry = async (jobId) => {
|
||||
const normalizedJobId = normalizeJobId(jobId);
|
||||
const retryJobRow = ripperJobs.find((item) => normalizeJobId(item?.id) === normalizedJobId) || null;
|
||||
const title = retryJobRow?.title || retryJobRow?.detected_title || `Job #${normalizedJobId || jobId}`;
|
||||
const mediaType = retryJobRow ? resolveMediaType(retryJobRow) : null;
|
||||
const diskLabel = mediaType === 'cd' ? 'CD' : 'Disk';
|
||||
const confirmed = await confirmModal({
|
||||
header: 'Rip neu starten',
|
||||
message: `Bitte lege die korrekte ${diskLabel} für "${title}" ein.\nSoll der Rip jetzt gestartet werden?`,
|
||||
acceptLabel: 'Rip starten',
|
||||
rejectLabel: 'Abbrechen'
|
||||
});
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (normalizedJobId) setJobBusy(normalizedJobId, true);
|
||||
try {
|
||||
const response = await api.retryJob(jobId);
|
||||
@@ -3304,7 +3398,6 @@ 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')
|
||||
@@ -3345,6 +3438,14 @@ export default function RipperPage({
|
||||
const seriesTitleSuffix = mediaIndicator.isSeriesDvd
|
||||
? `${seriesSeasonLabel}${seriesDiscLabel}${seriesContainerLabel}`
|
||||
: '';
|
||||
const discWorkflowKind = resolveDiscWorkflowKind({
|
||||
mediaType: mediaIndicator.mediaType,
|
||||
selectedMetadata,
|
||||
analyzeContext,
|
||||
pipelineContext: pipelineForJob?.context || null,
|
||||
fallbackIsSeries: Boolean(mediaIndicator.isSeriesVideo)
|
||||
});
|
||||
const discWorkflowBadgeLabel = getDiscWorkflowBadgeLabel(mediaIndicator.mediaType, discWorkflowKind);
|
||||
const jobKindRaw = String(job?.job_kind || '').trim().toLowerCase();
|
||||
const isMultipartMovie = Number(job?.is_multipart_movie || 0) === 1
|
||||
|| jobKindRaw === 'multipart_movie_child'
|
||||
@@ -3478,7 +3579,7 @@ export default function RipperPage({
|
||||
) : null}
|
||||
<div className="ripper-job-badges">
|
||||
<Tag value={statusBadgeValue} severity={statusBadgeSeverity} />
|
||||
{mediaIndicator.isSeriesDvd ? <Tag value={seriesTagLabel} severity="secondary" /> : null}
|
||||
{discWorkflowBadgeLabel ? <Tag value={discWorkflowBadgeLabel} 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}
|
||||
@@ -3486,7 +3587,6 @@ export default function RipperPage({
|
||||
{normalizedStatus === 'READY_TO_ENCODE'
|
||||
? <Tag value={reviewConfirmed ? 'Review bestätigt' : 'Review offen'} severity={reviewConfirmed ? 'success' : 'warning'} />
|
||||
: null}
|
||||
<JobStepChecks backupSuccess={Boolean(job?.backupSuccess)} encodeSuccess={Boolean(job?.encodeSuccess)} />
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
@@ -3872,7 +3972,7 @@ export default function RipperPage({
|
||||
</div>
|
||||
<div className="ripper-job-badges">
|
||||
<Tag value={statusBadgeValue} severity={statusBadgeSeverity} />
|
||||
{mediaIndicator.isSeriesDvd ? <Tag value={seriesTagLabel} severity="secondary" /> : null}
|
||||
{discWorkflowBadgeLabel ? <Tag value={discWorkflowBadgeLabel} 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}
|
||||
|
||||
Reference in new issue
Block a user