0.12.0-7 remove legacy

This commit is contained in:
2026-03-22 14:43:10 +00:00
parent b773c2aa1d
commit fb5ee7e4dd
12 changed files with 137 additions and 826 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "ripster-frontend",
"version": "0.12.0-6",
"version": "0.12.0-7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ripster-frontend",
"version": "0.12.0-6",
"version": "0.12.0-7",
"dependencies": {
"primeicons": "^7.0.0",
"primereact": "^10.9.2",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ripster-frontend",
"version": "0.12.0-6",
"version": "0.12.0-7",
"private": true,
"type": "module",
"scripts": {
@@ -5,7 +5,6 @@ import { Tag } from 'primereact/tag';
import blurayIndicatorIcon from '../assets/media-bluray.svg';
import discIndicatorIcon from '../assets/media-disc.svg';
import otherIndicatorIcon from '../assets/media-other.svg';
import { resolveJobPluginExecution } from '../utils/pluginExecution';
import { getProcessStatusLabel, getStatusLabel } from '../utils/statusPresentation';
const CD_FORMAT_LABELS = {
@@ -725,9 +724,6 @@ export default function JobDetailDialog({
const mediaTypeAlt = mediaTypeLabel;
const statusMeta = statusBadgeMeta(job?.status, queueLocked);
const omdbInfo = job?.omdbInfo && typeof job.omdbInfo === 'object' ? job.omdbInfo : {};
const pluginExecution = resolveJobPluginExecution(job, null, {
currentStatus: job?.status
});
const configuredSelection = buildConfiguredScriptAndChainSelection(job);
const hasConfiguredSelection = configuredSelection.preScriptIds.length > 0
|| configuredSelection.postScriptIds.length > 0
@@ -928,12 +924,6 @@ export default function JobDetailDialog({
<i className={`pi ${statusMeta.icon}`} aria-hidden="true" />
</span>
</span>
{pluginExecution ? (
<>
<span className="job-infos-sep">|</span>
<Tag value={pluginExecution.label} severity="warning" title={pluginExecution.title} />
</>
) : null}
<span className="job-infos-sep">|</span>
{isCd ? (
<>
-7
View File
@@ -20,7 +20,6 @@ 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 { resolveJobPluginExecution } from '../utils/pluginExecution';
import { getStatusLabel, getStatusSeverity, normalizeStatus } from '../utils/statusPresentation';
const processingStates = ['ANALYZING', 'RIPPING', 'MEDIAINFO_CHECK', 'ENCODING', 'CD_ANALYZING', 'CD_RIPPING', 'CD_ENCODING'];
@@ -2834,10 +2833,6 @@ export default function DashboardPage({
? pipelineForJob.context.selectedMetadata
: {};
const audiobookChapterCount = Array.isArray(audiobookMeta?.chapters) ? audiobookMeta.chapters.length : 0;
const pluginExecution = resolveJobPluginExecution(job, pipelineForJob?.context, {
currentStatus: jobState
});
if (isExpanded) {
return (
<div key={jobId} className="dashboard-job-expanded">
@@ -2859,7 +2854,6 @@ export default function DashboardPage({
</strong>
<div className="dashboard-job-badges">
<Tag value={statusBadgeValue} severity={statusBadgeSeverity} />
{pluginExecution ? <Tag value={pluginExecution.label} severity="warning" title={pluginExecution.title} /> : null}
{isCurrentSession ? <Tag value="Aktive Session" severity="info" /> : null}
{isResumable ? <Tag value="Fortsetzbar" severity="success" /> : null}
{normalizedStatus === 'READY_TO_ENCODE'
@@ -2993,7 +2987,6 @@ export default function DashboardPage({
</div>
<div className="dashboard-job-badges">
<Tag value={statusBadgeValue} severity={statusBadgeSeverity} />
{pluginExecution ? <Tag value={pluginExecution.label} severity="warning" title={pluginExecution.title} /> : null}
{isCurrentSession ? <Tag value="Aktive Session" severity="info" /> : null}
{isResumable ? <Tag value="Fortsetzbar" severity="success" /> : null}
{normalizedStatus === 'READY_TO_ENCODE'
-138
View File
@@ -1,138 +0,0 @@
function normalizeStage(value) {
const stage = String(value || '').trim().toLowerCase();
return stage || null;
}
function normalizeStatus(value) {
return String(value || '').trim().toUpperCase() || null;
}
function inferExpectedPluginStage({ currentStatus = null, currentStage = null } = {}) {
const explicitStage = normalizeStage(currentStage);
if (explicitStage) {
return explicitStage;
}
const status = normalizeStatus(currentStatus);
if (!status) {
return null;
}
if (
status === 'ANALYZING'
|| status === 'CD_ANALYZING'
|| status === 'METADATA_SELECTION'
|| status === 'CD_METADATA_SELECTION'
|| status === 'CD_READY_TO_RIP'
) {
return 'analyze';
}
if (status === 'RIPPING' || status === 'CD_RIPPING') {
return 'rip';
}
if (status === 'MEDIAINFO_CHECK' || status === 'WAITING_FOR_USER_DECISION' || status === 'READY_TO_ENCODE') {
return 'review';
}
if (status === 'ENCODING' || status === 'CD_ENCODING') {
return 'encode';
}
return null;
}
function matchesExpectedStage(executionState, expectedStage) {
if (!executionState) {
return false;
}
if (!expectedStage) {
return true;
}
const stages = Array.isArray(executionState.stages) ? executionState.stages : [];
if (stages.length === 0) {
return true;
}
return stages.includes(expectedStage);
}
const STAGE_LABELS = {
analyze: 'Analyse',
rip: 'Rip',
review: 'Review',
encode: 'Encode',
finalize: 'Finalize',
oncancel: 'Cancel',
onretry: 'Retry'
};
export function normalizePluginExecutionState(rawState) {
if (!rawState || typeof rawState !== 'object' || Array.isArray(rawState)) {
return null;
}
const markerSource = String(rawState.markerSource || '').trim().toLowerCase();
const pluginFile = String(rawState.pluginFile || '').trim();
if (markerSource !== 'plugin-file' || !pluginFile) {
return null;
}
const pluginId = String(rawState.pluginId || '').trim().toLowerCase() || null;
const pluginName = String(rawState.pluginName || '').trim() || pluginId || 'Plugin';
const explicitStages = Array.isArray(rawState.stages)
? rawState.stages.map((stage) => normalizeStage(stage)).filter(Boolean)
: [];
const byStage = rawState.byStage && typeof rawState.byStage === 'object' && !Array.isArray(rawState.byStage)
? rawState.byStage
: {};
const stages = Array.from(new Set([
...explicitStages,
...Object.keys(byStage).map((stage) => normalizeStage(stage)).filter(Boolean),
...[normalizeStage(rawState.lastStage)].filter(Boolean)
]));
const stageLabels = stages.map((stage) => STAGE_LABELS[stage] || stage);
const titleParts = [
`Plugin-Code aktiv: ${pluginName}`,
pluginId ? `ID: ${pluginId}` : null,
`Datei: ${pluginFile}`,
stageLabels.length > 0 ? `Phasen: ${stageLabels.join(', ')}` : null
].filter(Boolean);
return {
markerSource,
pluginId,
pluginName,
pluginFile,
stages,
stageLabels,
label: `Beta: ${pluginName}`,
title: titleParts.join(' | ')
};
}
export function resolveJobPluginExecution(job = null, liveContext = null, options = {}) {
const liveExecution = normalizePluginExecutionState(liveContext?.pluginExecution);
const makemkvExecution = normalizePluginExecutionState(job?.makemkvInfo?.pluginExecution);
const mediainfoExecution = normalizePluginExecutionState(job?.mediainfoInfo?.pluginExecution);
const handbrakeExecution = normalizePluginExecutionState(job?.handbrakeInfo?.pluginExecution);
const jobExecution = normalizePluginExecutionState(job?.pluginExecution);
const expectedStage = inferExpectedPluginStage(options);
const candidates = [liveExecution, handbrakeExecution, mediainfoExecution, makemkvExecution, jobExecution].filter(Boolean);
if (candidates.length === 0) {
return null;
}
if (!expectedStage) {
return candidates[0];
}
const stageMatch = candidates.find((state) => matchesExpectedStage(state, expectedStage));
if (stageMatch) {
return stageMatch;
}
return null;
}
export function inferPluginStageFromStatus(status) {
return inferExpectedPluginStage({ currentStatus: status });
}