Merge pull request #6363 from duplicati/feature/dont-add-extra-dashes

No extra dashes on direct restore
This commit is contained in:
Kenneth Skovhede
2025-06-23 11:02:25 +02:00
committed by GitHub
@@ -42,14 +42,20 @@ backupApp.controller('RestoreDirectController', function ($rootScope, $scope, $l
var opts = {};
var obj = {'Backup': {'TargetURL': $scope.TargetURL } };
if (($scope.EncryptionPassphrase || '') == '')
opts['--no-encryption'] = 'true';
else
opts['passphrase'] = $scope.EncryptionPassphrase;
if (!AppUtils.parse_extra_options($scope.ExtendedOptions, opts))
return false;
if (($scope.EncryptionPassphrase || '') == '')
{
opts['--no-encryption'] = 'true';
delete opts['passphrase'];
}
else
{
opts['passphrase'] = $scope.EncryptionPassphrase;
delete opts['--no-encryption'];
}
obj.Backup.Settings = [];
for(var k in opts) {
obj.Backup.Settings.push({
@@ -118,6 +124,8 @@ backupApp.controller('RestoreDirectController', function ($rootScope, $scope, $l
if (tmpsettings[i].Name == 'passphrase') {
$scope.EncryptionPassphrase = tmpsettings[i].Value;
tmpsettings.splice(i, 1);
} else if (tmpsettings[i].Name.indexOf('--') == 0) {
res[tmpsettings[i].Name] = tmpsettings[i].Value;
} else {
res['--' + tmpsettings[i].Name] = tmpsettings[i].Value;
}