only update aria2 download and global settings when they change
This commit is contained in:
parent
87f807a5fe
commit
091fbb0d41
|
@ -57,11 +57,14 @@ angular
|
|||
delete self.inst;
|
||||
if (self.cb) {
|
||||
var settings = {};
|
||||
// no need to send in default values, just the changed ones
|
||||
for (var i in self.settings) {
|
||||
settings[i] = self.settings[i].val;
|
||||
if (fsettings[i].val != self.settings[i].val)
|
||||
settings[i] = self.settings[i].val;
|
||||
}
|
||||
for (var i in self.fsettings) {
|
||||
settings[i] = self.fsettings[i].val;
|
||||
if (fsettings[i].val != self.fsettings[i].val)
|
||||
settings[i] = self.fsettings[i].val;
|
||||
}
|
||||
|
||||
console.log('sending settings:', settings);
|
||||
|
@ -152,11 +155,15 @@ angular
|
|||
if (cb) {
|
||||
parseFiles(self.files, function(txts) {
|
||||
var settings = {};
|
||||
|
||||
// no need to send in default values, just the changed ones
|
||||
for (var i in self.settings) {
|
||||
settings[i] = self.settings[i].val;
|
||||
if (fsettings[i].val != self.settings[i].val)
|
||||
settings[i] = self.settings[i].val;
|
||||
}
|
||||
for (var i in self.fsettings) {
|
||||
settings[i] = self.fsettings[i].val;
|
||||
if (fsettings[i].val != self.fsettings[i].val)
|
||||
settings[i] = self.fsettings[i].val;
|
||||
}
|
||||
|
||||
console.log('sending settings:', settings);
|
||||
|
|
|
@ -103,19 +103,22 @@ angular
|
|||
}
|
||||
|
||||
modals.invoke(
|
||||
'settings', settings,
|
||||
'Global Settings', 'Save', function(settings) {
|
||||
'settings', _.cloneDeep(settings),
|
||||
'Global Settings', 'Save', function(chsettings) {
|
||||
|
||||
var sets = {};
|
||||
var starred = [];
|
||||
for (var i in settings) {
|
||||
sets[i] = settings[i].val
|
||||
for (var i in chsettings) {
|
||||
// no need to change default values
|
||||
if (settings[i].val != chsettings[i].val)
|
||||
sets[i] = chsettings[i].val
|
||||
|
||||
if (settings[i].starred) {
|
||||
if (chsettings[i].starred) {
|
||||
starred.push(i);
|
||||
}
|
||||
};
|
||||
|
||||
console.log('saving aria2 settings:', sets);
|
||||
console.log('saving aria2 starred:', starred);
|
||||
|
||||
rpc.once('changeGlobalOption', [sets]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user