0.11.0-1 queue fix
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ripster-backend",
|
"name": "ripster-backend",
|
||||||
"version": "0.11.0",
|
"version": "0.11.0-1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ripster-backend",
|
"name": "ripster-backend",
|
||||||
"version": "0.11.0",
|
"version": "0.11.0-1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"archiver": "^7.0.1",
|
"archiver": "^7.0.1",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ripster-backend",
|
"name": "ripster-backend",
|
||||||
"version": "0.11.0",
|
"version": "0.11.0-1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -964,7 +964,7 @@ async function migrateSettingsSchemaMetadata(db) {
|
|||||||
|
|
||||||
await db.run(
|
await db.run(
|
||||||
`INSERT OR IGNORE INTO settings_schema (key, category, label, type, required, description, default_value, options_json, validation_json, order_index)
|
`INSERT OR IGNORE INTO settings_schema (key, category, label, type, required, description, default_value, options_json, validation_json, order_index)
|
||||||
VALUES ('drive_devices', 'Laufwerk', 'Explizite Laufwerke', 'path', 0, 'Laufwerkspfade für den expliziten Modus als JSON-Array, z.B. [\"/dev/sr0\",\"/dev/sr1\"]. Nur relevant wenn Modus = Explizites Device.', '[]', '[]', '{}', 15)`
|
VALUES ('drive_devices', 'Laufwerk', 'Explizite Laufwerke', 'path', 0, 'Laufwerke für den expliziten Modus als JSON-Array mit Pfad und MakeMKV-Index, z.B. [{\"path\":\"/dev/sr0\",\"makemkvIndex\":0},{\"path\":\"/dev/sr1\",\"makemkvIndex\":1}]. Nur relevant wenn Modus = Explizites Device.', '[]', '[]', '{}', 15)`
|
||||||
);
|
);
|
||||||
await db.run(`INSERT OR IGNORE INTO settings_values (key, value) VALUES ('drive_devices', '[]')`);
|
await db.run(`INSERT OR IGNORE INTO settings_values (key, value) VALUES ('drive_devices', '[]')`);
|
||||||
|
|
||||||
|
|||||||
@@ -447,7 +447,9 @@ class DiskDetectionService extends EventEmitter {
|
|||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(settingsMap.drive_devices || '[]');
|
const parsed = JSON.parse(settingsMap.drive_devices || '[]');
|
||||||
if (Array.isArray(parsed)) {
|
if (Array.isArray(parsed)) {
|
||||||
explicitPaths = parsed.map((p) => String(p || '').trim()).filter(Boolean);
|
explicitPaths = parsed
|
||||||
|
.map((e) => (typeof e === 'string' ? e.trim() : String(e?.path || '').trim()))
|
||||||
|
.filter(Boolean);
|
||||||
}
|
}
|
||||||
} catch (_error) {
|
} catch (_error) {
|
||||||
// malformed JSON — ignore, fall through to legacy
|
// malformed JSON — ignore, fall through to legacy
|
||||||
|
|||||||
@@ -5158,9 +5158,11 @@ class PipelineService extends EventEmitter {
|
|||||||
const isNonJob = candidate.type && candidate.type !== 'job';
|
const isNonJob = candidate.type && candidate.type !== 'job';
|
||||||
|
|
||||||
if (isNonJob) {
|
if (isNonJob) {
|
||||||
// Non-job entries (script, chain, wait) always start immediately
|
// Non-job entries (script, chain, wait) only start when no jobs are running
|
||||||
entryIndex = i;
|
if (totalRunning === 0) {
|
||||||
break;
|
entryIndex = i;
|
||||||
|
}
|
||||||
|
break; // FIFO: stop scanning regardless (non-job blocks everything behind it)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Job entry: check hierarchical limits
|
// Job entry: check hierarchical limits
|
||||||
@@ -5311,7 +5313,10 @@ class PipelineService extends EventEmitter {
|
|||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(settingsMap?.drive_devices || '[]');
|
const parsed = JSON.parse(settingsMap?.drive_devices || '[]');
|
||||||
if (Array.isArray(parsed)) {
|
if (Array.isArray(parsed)) {
|
||||||
parsed.map((p) => String(p || '').trim()).filter(Boolean).forEach((p) => devicesToEject.push(p));
|
parsed
|
||||||
|
.map((e) => (typeof e === 'string' ? e.trim() : String(e?.path || '').trim()))
|
||||||
|
.filter(Boolean)
|
||||||
|
.forEach((p) => devicesToEject.push(p));
|
||||||
}
|
}
|
||||||
} catch (_error) {
|
} catch (_error) {
|
||||||
// ignore
|
// ignore
|
||||||
@@ -13488,7 +13493,7 @@ class PipelineService extends EventEmitter {
|
|||||||
title: 'Ripster - CD Rip erfolgreich',
|
title: 'Ripster - CD Rip erfolgreich',
|
||||||
message: `Job #${jobId}: ${selectedMeta?.title || 'Audio CD'}`
|
message: `Job #${jobId}: ${selectedMeta?.title || 'Audio CD'}`
|
||||||
});
|
});
|
||||||
void this.ejectDriveIfEnabled(settings);
|
void settingsService.getSettingsMap().then((cdSettings) => this.ejectDriveIfEnabled(cdSettings, devicePath));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
settleLifecycle();
|
settleLifecycle();
|
||||||
const failedCdLive = buildLiveContext(currentTrackPosition || null);
|
const failedCdLive = buildLiveContext(currentTrackPosition || null);
|
||||||
|
|||||||
@@ -572,6 +572,45 @@ function mapPresetEntriesToOptions(entries) {
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses the drive_devices JSON setting into a normalized array of {path, makemkvIndex}.
|
||||||
|
* Supports both the legacy string format ["/dev/sr0"] and the object format
|
||||||
|
* [{"path": "/dev/sr0", "makemkvIndex": 0}].
|
||||||
|
* When makemkvIndex is missing, it is auto-derived from the device name (sr0→0, sr1→1).
|
||||||
|
*/
|
||||||
|
function parseDriveDeviceEntries(raw) {
|
||||||
|
try {
|
||||||
|
const arr = JSON.parse(raw || '[]');
|
||||||
|
if (!Array.isArray(arr)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return arr.map((entry) => {
|
||||||
|
if (typeof entry === 'string') {
|
||||||
|
const p = entry.trim();
|
||||||
|
if (!p) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const m = p.match(/sr(\d+)$/);
|
||||||
|
return { path: p, makemkvIndex: m ? Number(m[1]) : 0 };
|
||||||
|
}
|
||||||
|
if (entry && typeof entry === 'object' && entry.path) {
|
||||||
|
const p = String(entry.path || '').trim();
|
||||||
|
if (!p) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const idxRaw = entry.makemkvIndex != null ? Number(entry.makemkvIndex) : null;
|
||||||
|
const m = p.match(/sr(\d+)$/);
|
||||||
|
const derived = m ? Number(m[1]) : 0;
|
||||||
|
const idx = Number.isFinite(idxRaw) && idxRaw >= 0 ? Math.trunc(idxRaw) : derived;
|
||||||
|
return { path: p, makemkvIndex: idx };
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}).filter(Boolean);
|
||||||
|
} catch (_error) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class SettingsService {
|
class SettingsService {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.settingsSnapshotCache = {
|
this.settingsSnapshotCache = {
|
||||||
@@ -1192,21 +1231,12 @@ class SettingsService {
|
|||||||
|
|
||||||
resolveHandBrakeSourceArg(map, deviceInfo = null) {
|
resolveHandBrakeSourceArg(map, deviceInfo = null) {
|
||||||
if (map.drive_mode === 'explicit') {
|
if (map.drive_mode === 'explicit') {
|
||||||
// Prefer drive_devices array, fall back to legacy drive_device
|
const entries = parseDriveDeviceEntries(map.drive_devices);
|
||||||
let explicitPaths = [];
|
const firstPath = entries[0]?.path || String(map.drive_device || '').trim();
|
||||||
try {
|
if (!firstPath) {
|
||||||
const parsed = JSON.parse(map.drive_devices || '[]');
|
|
||||||
if (Array.isArray(parsed)) {
|
|
||||||
explicitPaths = parsed.map((p) => String(p || '').trim()).filter(Boolean);
|
|
||||||
}
|
|
||||||
} catch (_error) {
|
|
||||||
// ignore parse error
|
|
||||||
}
|
|
||||||
const firstExplicit = explicitPaths[0] || String(map.drive_device || '').trim();
|
|
||||||
if (!firstExplicit) {
|
|
||||||
throw new Error('Kein Laufwerk konfiguriert, obwohl drive_mode=explicit gesetzt ist.');
|
throw new Error('Kein Laufwerk konfiguriert, obwohl drive_mode=explicit gesetzt ist.');
|
||||||
}
|
}
|
||||||
return firstExplicit;
|
return firstPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const detectedPath = String(deviceInfo?.path || '').trim();
|
const detectedPath = String(deviceInfo?.path || '').trim();
|
||||||
@@ -1214,15 +1244,10 @@ class SettingsService {
|
|||||||
return detectedPath;
|
return detectedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback: first explicit device, or legacy drive_device
|
// Fallback: first configured device or legacy drive_device
|
||||||
try {
|
const entries = parseDriveDeviceEntries(map.drive_devices);
|
||||||
const parsed = JSON.parse(map.drive_devices || '[]');
|
if (entries.length > 0) {
|
||||||
if (Array.isArray(parsed) && parsed.length > 0) {
|
return entries[0].path;
|
||||||
const first = String(parsed[0] || '').trim();
|
|
||||||
if (first) return first;
|
|
||||||
}
|
|
||||||
} catch (_error) {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
const configuredPath = String(map.drive_device || '').trim();
|
const configuredPath = String(map.drive_device || '').trim();
|
||||||
if (configuredPath) {
|
if (configuredPath) {
|
||||||
@@ -1385,10 +1410,28 @@ class SettingsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resolveSourceArg(map, deviceInfo = null) {
|
resolveSourceArg(map, deviceInfo = null) {
|
||||||
// Single-drive setup: always use MakeMKV's first logical disc device.
|
const devicePath = String(deviceInfo?.path || '').trim();
|
||||||
void map;
|
|
||||||
void deviceInfo;
|
// In explicit mode: look up per-drive makemkvIndex from drive_devices
|
||||||
return 'disc:0';
|
if (devicePath && map.drive_mode === 'explicit') {
|
||||||
|
const entries = parseDriveDeviceEntries(map.drive_devices);
|
||||||
|
const entry = entries.find((e) => e.path === devicePath);
|
||||||
|
if (entry) {
|
||||||
|
return `disc:${entry.makemkvIndex}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Auto-derive from device name (/dev/sr0 → disc:0, /dev/sr1 → disc:1)
|
||||||
|
if (devicePath) {
|
||||||
|
const match = devicePath.match(/sr(\d+)$/);
|
||||||
|
if (match) {
|
||||||
|
return `disc:${match[1]}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fall back to global makemkv_source_index setting
|
||||||
|
const sourceIndex = Number(map.makemkv_source_index ?? 0);
|
||||||
|
return `disc:${Number.isFinite(sourceIndex) && sourceIndex >= 0 ? Math.trunc(sourceIndex) : 0}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadHandBrakePresetOptionsFromCli(map = {}) {
|
async loadHandBrakePresetOptionsFromCli(map = {}) {
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ripster-frontend",
|
"name": "ripster-frontend",
|
||||||
"version": "0.11.0",
|
"version": "0.11.0-1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ripster-frontend",
|
"name": "ripster-frontend",
|
||||||
"version": "0.11.0",
|
"version": "0.11.0-1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"primeicons": "^7.0.0",
|
"primeicons": "^7.0.0",
|
||||||
"primereact": "^10.9.2",
|
"primereact": "^10.9.2",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ripster-frontend",
|
"name": "ripster-frontend",
|
||||||
"version": "0.11.0",
|
"version": "0.11.0-1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -92,7 +92,18 @@ function DriveDevicesEditor({ value, onChange, settingKey }) {
|
|||||||
const parseDevices = (val) => {
|
const parseDevices = (val) => {
|
||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(val || '[]');
|
const parsed = JSON.parse(val || '[]');
|
||||||
return Array.isArray(parsed) ? parsed.map(String) : [];
|
if (!Array.isArray(parsed)) return [];
|
||||||
|
return parsed.map((e) => {
|
||||||
|
if (typeof e === 'string') {
|
||||||
|
const p = e.trim();
|
||||||
|
const m = p.match(/sr(\d+)$/);
|
||||||
|
return { path: p, makemkvIndex: m ? Number(m[1]) : 0 };
|
||||||
|
}
|
||||||
|
if (e && typeof e === 'object') {
|
||||||
|
return { path: String(e.path || '').trim(), makemkvIndex: Number.isFinite(Number(e.makemkvIndex)) ? Number(e.makemkvIndex) : 0 };
|
||||||
|
}
|
||||||
|
return { path: '', makemkvIndex: 0 };
|
||||||
|
});
|
||||||
} catch (_e) {
|
} catch (_e) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@@ -109,18 +120,35 @@ function DriveDevicesEditor({ value, onChange, settingKey }) {
|
|||||||
{devices.length === 0 && (
|
{devices.length === 0 && (
|
||||||
<p className="drive-devices-empty">Keine expliziten Laufwerke konfiguriert.</p>
|
<p className="drive-devices-empty">Keine expliziten Laufwerke konfiguriert.</p>
|
||||||
)}
|
)}
|
||||||
{devices.map((path, idx) => (
|
{devices.map((dev, idx) => (
|
||||||
<div key={idx} className="drive-device-row">
|
<div key={idx} className="drive-device-row">
|
||||||
<InputText
|
<InputText
|
||||||
value={path}
|
value={dev.path}
|
||||||
placeholder="/dev/sr0"
|
placeholder="/dev/sr0"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const next = [...devices];
|
const next = [...devices];
|
||||||
next[idx] = e.target.value;
|
const p = e.target.value;
|
||||||
|
const m = p.match(/sr(\d+)$/);
|
||||||
|
next[idx] = { ...next[idx], path: p, makemkvIndex: m ? Number(m[1]) : next[idx].makemkvIndex };
|
||||||
updateDevices(next);
|
updateDevices(next);
|
||||||
}}
|
}}
|
||||||
className="drive-device-input"
|
className="drive-device-input"
|
||||||
/>
|
/>
|
||||||
|
<InputNumber
|
||||||
|
value={dev.makemkvIndex}
|
||||||
|
min={0}
|
||||||
|
max={9}
|
||||||
|
showButtons={false}
|
||||||
|
placeholder="Idx"
|
||||||
|
title="MakeMKV disc index (disc:N)"
|
||||||
|
style={{ width: '4rem' }}
|
||||||
|
inputStyle={{ textAlign: 'center' }}
|
||||||
|
onChange={(e) => {
|
||||||
|
const next = [...devices];
|
||||||
|
next[idx] = { ...next[idx], makemkvIndex: e.value ?? 0 };
|
||||||
|
updateDevices(next);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<Button
|
<Button
|
||||||
icon="pi pi-trash"
|
icon="pi pi-trash"
|
||||||
severity="danger"
|
severity="danger"
|
||||||
@@ -139,7 +167,10 @@ function DriveDevicesEditor({ value, onChange, settingKey }) {
|
|||||||
severity="secondary"
|
severity="secondary"
|
||||||
text
|
text
|
||||||
size="small"
|
size="small"
|
||||||
onClick={() => updateDevices([...devices, ''])}
|
onClick={() => {
|
||||||
|
const nextIdx = devices.length;
|
||||||
|
updateDevices([...devices, { path: '', makemkvIndex: nextIdx }]);
|
||||||
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2266,18 +2266,26 @@ export default function DashboardPage({
|
|||||||
: driveState === 'ERROR' || driveState === 'CANCELLED' ? 'danger'
|
: driveState === 'ERROR' || driveState === 'CANCELLED' ? 'danger'
|
||||||
: ['CD_RIPPING', 'CD_ENCODING'].includes(driveState) ? 'warning'
|
: ['CD_RIPPING', 'CD_ENCODING'].includes(driveState) ? 'warning'
|
||||||
: 'info';
|
: 'info';
|
||||||
|
const driveProgress = Number(drive?.progress ?? 0);
|
||||||
|
const driveStatusText = drive?.statusText || null;
|
||||||
|
const isActiveRip = ['CD_RIPPING', 'CD_ENCODING', 'CD_ANALYZING'].includes(driveState);
|
||||||
return (
|
return (
|
||||||
<div key={drivePath} className="cd-drive-item">
|
<div key={drivePath} className="cd-drive-item">
|
||||||
<div className="cd-drive-header">
|
<div className="cd-drive-header">
|
||||||
<strong>{driveDevice.model || 'CD-Laufwerk'}</strong>
|
|
||||||
<code className="cd-drive-path">{drivePath}</code>
|
<code className="cd-drive-path">{drivePath}</code>
|
||||||
<Tag value={driveState} severity={cdStateSeverity} />
|
<Tag value={driveState} severity={cdStateSeverity} />
|
||||||
</div>
|
</div>
|
||||||
{driveDevice.discLabel && (
|
{(driveDevice.discLabel || driveDevice.model) && (
|
||||||
<div className="cd-drive-disc-label">
|
<div className="cd-drive-disc-label">
|
||||||
<strong>Disc:</strong> {driveDevice.discLabel}
|
{driveDevice.discLabel || driveDevice.model}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
{isActiveRip && (
|
||||||
|
<ProgressBar value={driveProgress} style={{ height: '6px', margin: '0.2rem 0' }} showValue={false} />
|
||||||
|
)}
|
||||||
|
{isActiveRip && driveStatusText && (
|
||||||
|
<div className="cd-drive-status-text">{driveStatusText}</div>
|
||||||
|
)}
|
||||||
<div className="cd-drive-actions">
|
<div className="cd-drive-actions">
|
||||||
{driveState === 'DISC_DETECTED' && (
|
{driveState === 'DISC_DETECTED' && (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -1789,6 +1789,14 @@ body {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cd-drive-status-text {
|
||||||
|
font-size: 0.75rem;
|
||||||
|
color: var(--rip-muted);
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
.notification-toggle-box {
|
.notification-toggle-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ripster",
|
"name": "ripster",
|
||||||
"version": "0.11.0",
|
"version": "0.11.0-1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ripster",
|
"name": "ripster",
|
||||||
"version": "0.11.0",
|
"version": "0.11.0-1",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"concurrently": "^9.1.2"
|
"concurrently": "^9.1.2"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ripster",
|
"name": "ripster",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.11.0",
|
"version": "0.11.0-1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "concurrently \"npm run dev --prefix backend\" \"npm run dev --prefix frontend\"",
|
"dev": "concurrently \"npm run dev --prefix backend\" \"npm run dev --prefix frontend\"",
|
||||||
"dev:backend": "npm run dev --prefix backend",
|
"dev:backend": "npm run dev --prefix backend",
|
||||||
|
|||||||
Reference in New Issue
Block a user