0.11.0 Multi LW
This commit is contained in:
@@ -1192,11 +1192,21 @@ class SettingsService {
|
||||
|
||||
resolveHandBrakeSourceArg(map, deviceInfo = null) {
|
||||
if (map.drive_mode === 'explicit') {
|
||||
const device = String(map.drive_device || '').trim();
|
||||
if (!device) {
|
||||
throw new Error('drive_device ist leer, obwohl drive_mode=explicit gesetzt ist.');
|
||||
// Prefer drive_devices array, fall back to legacy drive_device
|
||||
let explicitPaths = [];
|
||||
try {
|
||||
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
|
||||
}
|
||||
return device;
|
||||
const firstExplicit = explicitPaths[0] || String(map.drive_device || '').trim();
|
||||
if (!firstExplicit) {
|
||||
throw new Error('Kein Laufwerk konfiguriert, obwohl drive_mode=explicit gesetzt ist.');
|
||||
}
|
||||
return firstExplicit;
|
||||
}
|
||||
|
||||
const detectedPath = String(deviceInfo?.path || '').trim();
|
||||
@@ -1204,6 +1214,16 @@ class SettingsService {
|
||||
return detectedPath;
|
||||
}
|
||||
|
||||
// Fallback: first explicit device, or legacy drive_device
|
||||
try {
|
||||
const parsed = JSON.parse(map.drive_devices || '[]');
|
||||
if (Array.isArray(parsed) && parsed.length > 0) {
|
||||
const first = String(parsed[0] || '').trim();
|
||||
if (first) return first;
|
||||
}
|
||||
} catch (_error) {
|
||||
// ignore
|
||||
}
|
||||
const configuredPath = String(map.drive_device || '').trim();
|
||||
if (configuredPath) {
|
||||
return configuredPath;
|
||||
|
||||
Reference in New Issue
Block a user