0.10.2-22 History/Downloads

This commit is contained in:
2026-03-17 14:28:29 +00:00
parent cdb87b5759
commit ac91d83c45
10 changed files with 210 additions and 65 deletions
+76 -44
View File
@@ -1,3 +1,5 @@
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { Dialog } from 'primereact/dialog';
import { Button } from 'primereact/button';
import MediaInfoReviewPanel from './MediaInfoReviewPanel';
@@ -5,6 +7,7 @@ import blurayIndicatorIcon from '../assets/media-bluray.svg';
import discIndicatorIcon from '../assets/media-disc.svg';
import otherIndicatorIcon from '../assets/media-other.svg';
import { getStatusLabel } from '../utils/statusPresentation';
import { api } from '../api/client';
const CD_FORMAT_LABELS = {
flac: 'FLAC',
@@ -478,6 +481,15 @@ export default function JobDetailDialog({
deleteEntryBusy = false,
downloadBusyTarget = null
}) {
const [expertMode, setExpertMode] = useState(false);
useEffect(() => {
api.getSettings().then((res) => {
const allSettings = (res?.categories || []).flatMap((c) => c.settings || []);
const val = allSettings.find((s) => s.key === 'ui_expert_mode')?.value;
setExpertMode(val === 'true' || val === true);
}).catch(() => {});
}, []);
const mkDone = Boolean(job?.ripSuccessful) || !job?.makemkvInfo || job?.makemkvInfo?.status === 'SUCCESS';
const running = ['ANALYZING', 'RIPPING', 'MEDIAINFO_CHECK', 'ENCODING'].includes(job?.status);
const showFinalLog = !running;
@@ -579,7 +591,7 @@ export default function JobDetailDialog({
modal
>
{!job ? null : (
<>
<div className="job-detail-body">
{detailLoading ? <p>Details werden geladen ...</p> : null}
<div className="job-head-row">
@@ -792,33 +804,48 @@ export default function JobDetailDialog({
<strong>Fehler:</strong> {job.error_message}
</div>
) : null}
{expertMode ? (
<div className="job-meta-col-span-2">
<Link to={`/database?table=jobs&id=${job.id}`} className="job-db-link" onClick={onHide}>
<i className="pi pi-database" /> DB-Eintrag ansehen
</Link>
</div>
) : null}
</div>
</section>
{!isCd && (hasConfiguredSelection || encodePlanUserPreset || executedHandBrakeCommand || job.handbrakeInfo?.preEncodeScripts?.configured > 0 || job.handbrakeInfo?.postEncodeScripts?.configured > 0) ? (
{!isCd && (hasConfiguredSelection || encodePlanUserPreset || job.encodePlan?.minLengthMinutes != null || job.encodePlan?.playlistRecommendation || job.handbrakeInfo?.preEncodeScripts?.configured > 0 || job.handbrakeInfo?.postEncodeScripts?.configured > 0) ? (
<section className="job-meta-block job-meta-block-full">
<h4>Encode-Konfiguration</h4>
{(hasConfiguredSelection || encodePlanUserPreset) && !isAudiobook ? (
<div className="job-meta-grid job-meta-grid-compact job-meta-encode-config">
<div className="job-meta-grid job-meta-grid-compact">
{job.encodePlan?.minLengthMinutes != null && !isAudiobook ? (
<div>
<strong>Pre-Skripte:</strong> {configuredSelection.preScripts.length > 0 ? configuredSelection.preScripts.join(', ') : (configuredSelection.preChains.length > 0 ? configuredSelection.preChains.join(', ') : '-')}
<strong>Mindestlaufzeit:</strong> {job.encodePlan.minLengthMinutes} Min.
</div>
) : null}
{job.encodePlan?.playlistRecommendation && !isAudiobook ? (
<div>
<strong>Post-Skripte:</strong> {configuredSelection.postScripts.length > 0 ? configuredSelection.postScripts.join(', ') : (configuredSelection.postChains.length > 0 ? configuredSelection.postChains.join(', ') : '-')}
<strong>Playlist-Auswahl:</strong>{' '}
{job.encodePlan.playlistRecommendation.playlistFile || '-'}
{job.encodePlan.playlistRecommendation.reason ? `${job.encodePlan.playlistRecommendation.reason}` : ''}
</div>
{encodePlanUserPreset ? (
<div className="job-meta-col-span-2">
<strong>Preset:</strong> {encodePlanUserPreset.name || '-'}{encodePlanUserPreset.handbrakePreset ? ` · ${encodePlanUserPreset.handbrakePreset}` : ''}{encodePlanUserPreset.extraArgs ? ` · ${encodePlanUserPreset.extraArgs}` : ''}
) : null}
{(hasConfiguredSelection || encodePlanUserPreset) && !isAudiobook ? (
<>
<div>
<strong>Pre-Skripte:</strong> {configuredSelection.preScripts.length > 0 ? configuredSelection.preScripts.join(', ') : (configuredSelection.preChains.length > 0 ? configuredSelection.preChains.join(', ') : '-')}
</div>
) : null}
</div>
) : null}
{executedHandBrakeCommand ? (
<div className="handbrake-command-preview">
<small><strong>{isAudiobook ? 'FFmpeg' : 'HandBrakeCLI'}:</strong></small>
<pre>{executedHandBrakeCommand}</pre>
</div>
) : null}
<div>
<strong>Post-Skripte:</strong> {configuredSelection.postScripts.length > 0 ? configuredSelection.postScripts.join(', ') : (configuredSelection.postChains.length > 0 ? configuredSelection.postChains.join(', ') : '-')}
</div>
{encodePlanUserPreset ? (
<div className="job-meta-col-span-2">
<strong>Preset:</strong> {encodePlanUserPreset.name || '-'}{encodePlanUserPreset.handbrakePreset ? ` · ${encodePlanUserPreset.handbrakePreset}` : ''}{encodePlanUserPreset.extraArgs ? ` · ${encodePlanUserPreset.extraArgs}` : ''}
</div>
) : null}
</>
) : null}
</div>
{!isAudiobook && (job.handbrakeInfo?.preEncodeScripts?.configured > 0 || job.handbrakeInfo?.postEncodeScripts?.configured > 0) ? (
<div className="script-results-grid">
<ScriptSummarySection title="Pre-Encode" summary={job.handbrakeInfo?.preEncodeScripts} />
@@ -828,32 +855,37 @@ export default function JobDetailDialog({
</section>
) : null}
<div className="job-json-grid">
{!isCd && !isAudiobook ? <JsonView title="OMDb Info" value={job.omdbInfo} /> : null}
<JsonView title={isCd ? 'cdparanoia Info' : (isAudiobook ? 'Audiobook Info' : 'MakeMKV Info')} value={job.makemkvInfo} />
{!isCd && !isAudiobook ? <JsonView title="Mediainfo Info" value={job.mediainfoInfo} /> : null}
<JsonView title={isCd ? 'Rip-Plan' : 'Encode Plan'} value={job.encodePlan} />
{!isCd ? <JsonView title={isAudiobook ? 'FFmpeg Info' : 'HandBrake Info'} value={job.handbrakeInfo} /> : null}
</div>
<section className="job-meta-block job-meta-block-full">
<h4>Rohdaten</h4>
<div className="job-json-grid">
{!isCd && !isAudiobook ? <JsonView title="OMDb Info" value={job.omdbInfo} /> : null}
<JsonView title={isCd ? 'cdparanoia Info' : (isAudiobook ? 'Audiobook Info' : 'MakeMKV Info')} value={job.makemkvInfo} />
{!isCd && !isAudiobook ? <JsonView title="Mediainfo Info" value={job.mediainfoInfo} /> : null}
<JsonView title={isCd ? 'Rip-Plan' : 'Encode Plan'} value={job.encodePlan} />
{!isCd ? <JsonView title={isAudiobook ? 'FFmpeg Info' : 'HandBrake Info'} value={job.handbrakeInfo} /> : null}
</div>
</section>
{!isCd && !isAudiobook && job.encodePlan ? (
<>
<h4>Mediainfo-Prüfung (Auswertung)</h4>
<MediaInfoReviewPanel
review={job.encodePlan}
commandOutputPath={job.output_path || null}
selectedEncodeTitleId={reviewSelectedEncodeTitleId}
trackSelectionByTitle={reviewTrackSelectionByTitle}
availableScripts={configuredSelection.scriptCatalog}
availableChains={configuredSelection.chainCatalog}
preEncodeItems={reviewPreEncodeItems}
postEncodeItems={reviewPostEncodeItems}
userPresets={reviewUserPresets}
selectedUserPresetId={Number.isFinite(encodePlanUserPresetId) && encodePlanUserPresetId > 0
? Math.trunc(encodePlanUserPresetId)
: null}
/>
</>
{!isCd && !isAudiobook && Array.isArray(job.encodePlan?.titles) && job.encodePlan.titles.length > 0 ? (
<section className="job-meta-block job-meta-block-full">
<h4>Titel</h4>
<div className="job-titles-list">
{job.encodePlan.titles.map((t) => {
const isSelected = t.id === job.encodePlan.encodeInputTitleId || t.selectedForEncode;
const sizeMb = t.sizeBytes > 0 ? `${(t.sizeBytes / 1024 / 1024).toFixed(0)} MB` : null;
return (
<div key={t.id} className={`job-title-row${isSelected ? ' job-title-row-selected' : ''}`}>
<span className="job-title-id">#{t.id}</span>
<span className="job-title-name">{t.fileName || '-'}</span>
<span className="job-title-duration">{t.durationMinutes != null ? `${t.durationMinutes} Min.` : '-'}</span>
{sizeMb ? <span className="job-title-size">{sizeMb}</span> : null}
{t.playlistFile ? <span className="job-title-playlist">{t.playlistFile}</span> : null}
{isSelected ? <span className="job-title-selected-badge">gewählt</span> : null}
</div>
);
})}
</div>
</section>
) : null}
<h4>Log</h4>
@@ -1035,7 +1067,7 @@ export default function JobDetailDialog({
/>
</div>
) : null}
</>
</div>
)}
</Dialog>
);