This commit is contained in:
2026-03-12 11:00:33 +00:00
parent 519b7a30ef
commit 1e30f00b45

View File

@@ -949,7 +949,9 @@ class SettingsService {
const ripMode = String(map.makemkv_rip_mode || 'mkv').trim().toLowerCase() === 'backup' const ripMode = String(map.makemkv_rip_mode || 'mkv').trim().toLowerCase() === 'backup'
? 'backup' ? 'backup'
: 'mkv'; : 'mkv';
const sourceArg = this.resolveSourceArg(map, deviceInfo); const sourceArg = ripMode === 'backup'
? this.resolveBackupSourceArg(map, deviceInfo)
: this.resolveSourceArg(map, deviceInfo);
const rawSelectedTitleId = normalizeNonNegativeInteger(options?.selectedTitleId); const rawSelectedTitleId = normalizeNonNegativeInteger(options?.selectedTitleId);
const parsedExtra = splitArgs(map.makemkv_rip_extra_args); const parsedExtra = splitArgs(map.makemkv_rip_extra_args);
let extra = []; let extra = [];
@@ -1008,6 +1010,20 @@ class SettingsService {
return { cmd, args: [...baseArgs, ...extra] }; return { cmd, args: [...baseArgs, ...extra] };
} }
resolveBackupSourceArg(map, deviceInfo = null) {
const rawDeviceIndex = Number(deviceInfo?.index);
if (Number.isFinite(rawDeviceIndex) && rawDeviceIndex >= 0) {
return `disc:${Math.trunc(rawDeviceIndex)}`;
}
const rawConfiguredIndex = Number(map?.makemkv_source_index);
if (Number.isFinite(rawConfiguredIndex) && rawConfiguredIndex >= 0) {
return `disc:${Math.trunc(rawConfiguredIndex)}`;
}
return 'disc:0';
}
async buildMakeMKVRegisterConfig() { async buildMakeMKVRegisterConfig() {
const map = await this.getSettingsMap(); const map = await this.getSettingsMap();
const registrationKey = String(map.makemkv_registration_key || '').trim(); const registrationKey = String(map.makemkv_registration_key || '').trim();