fixed addUris settings bug

This commit is contained in:
hamza zia 2015-07-11 10:28:53 +05:00
parent 96b882f75a
commit c83cd702e4

View File

@ -15,11 +15,12 @@ angular.module('webui.services.rpc.helpers', [
_.each(uris, function(uri) { _.each(uris, function(uri) {
uri_parsed = []; uri_parsed = [];
// parse options passed in the URIs. E.g. http://ex1.com/f1.jpg --out=image.jpg --check-integrity // parse options passed in the URIs. E.g. http://ex1.com/f1.jpg --out=image.jpg --check-integrity
var uriSettings = _.cloneDeep(settings);
_.each(uri, function(uri_element) { _.each(uri, function(uri_element) {
if (uri_element.startsWith('--')) { if (uri_element.startsWith('--')) {
uri_options = uri_element.split(/--|=(.*)/); uri_options = uri_element.split(/--|=(.*)/);
if (uri_options.length > 2) { if (uri_options.length > 2) {
settings[uri_options[2]] = uri_options[3] || 'true'; uriSettings[uri_options[2]] = uri_options[3] || 'true';
} }
} }
else { else {
@ -27,7 +28,7 @@ angular.module('webui.services.rpc.helpers', [
} }
}); });
// passing true to batch all the addUri calls // passing true to batch all the addUri calls
rpc.once('addUri', [uri_parsed, settings], cb, true); rpc.once('addUri', [uri_parsed, uriSettings], cb, true);
}); });
// now dispatch all addUri syscalls // now dispatch all addUri syscalls