0.11.0 Multi LW
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useState } from 'react';
|
||||
import { Dialog } from 'primereact/dialog';
|
||||
import { Button } from 'primereact/button';
|
||||
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',
|
||||
@@ -529,15 +527,6 @@ 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;
|
||||
@@ -825,13 +814,6 @@ export default function JobDetailDialog({
|
||||
{job.error_message ? (
|
||||
<div><strong>Fehler:</strong> {job.error_message}</div>
|
||||
) : null}
|
||||
{expertMode ? (
|
||||
<div>
|
||||
<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>
|
||||
|
||||
@@ -948,6 +930,10 @@ export default function JobDetailDialog({
|
||||
const selectedSet = Array.isArray(job.encodePlan?.selectedTracks) && job.encodePlan.selectedTracks.length > 0
|
||||
? new Set(job.encodePlan.selectedTracks.map(Number))
|
||||
: null;
|
||||
const encodeResultMap = new Map(
|
||||
(Array.isArray(job.handbrakeInfo?.tracks) ? job.handbrakeInfo.tracks : [])
|
||||
.map((r) => [Number(r.position), r])
|
||||
);
|
||||
if (tracksRaw.length === 0) return <p className="job-meta-subtle">Keine Tracks vorhanden.</p>;
|
||||
return (
|
||||
<div className="track-group">
|
||||
@@ -962,11 +948,13 @@ export default function JobDetailDialog({
|
||||
? `${Math.floor(durationSec / 60)}:${String(Math.floor(durationSec % 60)).padStart(2, '0')} min`
|
||||
: '-';
|
||||
const selected = selectedSet ? selectedSet.has(pos) : track.selected !== false;
|
||||
const ripDone = job?.ripSuccessful != null;
|
||||
const encodeResult = encodeResultMap.get(pos);
|
||||
const encodeLabel = !selected ? 'Nicht übernommen'
|
||||
: ripDone ? (job.ripSuccessful ? 'Erfolgreich' : 'Fehler')
|
||||
: 'Übernommen';
|
||||
const encodeClass = !selected ? '' : ripDone ? (job.ripSuccessful ? 'tone-ok' : 'tone-no') : '';
|
||||
: encodeResult ? (encodeResult.success ? 'Erfolgreich' : 'Fehler')
|
||||
: (job?.ripSuccessful != null ? (job.ripSuccessful ? 'Erfolgreich' : 'Fehler') : 'Ausgewählt');
|
||||
const encodeClass = !selected ? ''
|
||||
: encodeResult ? (encodeResult.success ? 'tone-ok' : 'tone-no')
|
||||
: (job?.ripSuccessful != null ? (job.ripSuccessful ? 'tone-ok' : 'tone-no') : '');
|
||||
return (
|
||||
<div key={pos} className="track-item">
|
||||
<span>#{pos} | {label}{artist ? ` | ${artist}` : ''} | {durLabel}</span>
|
||||
|
||||
Reference in New Issue
Block a user