mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
last used quality profile is now used as default
This commit is contained in:
parent
465dc725c8
commit
e4e6bcae1d
16 changed files with 70 additions and 66 deletions
19
UI/Config.js
19
UI/Config.js
|
@ -1,6 +1,15 @@
|
|||
"use strict";
|
||||
define(['app'], function () {
|
||||
|
||||
NzbDrone.Config = {
|
||||
Events: {
|
||||
ConfigUpdatedEvent: 'ConfigUpdatedEvent'
|
||||
},
|
||||
Keys : {
|
||||
DefaultQualityProfileId: 'DefaultQualityProfileId'
|
||||
}
|
||||
};
|
||||
|
||||
NzbDrone.Config.GetValue = function (key, defaultValue) {
|
||||
|
||||
var storeValue = localStorage.getItem(key);
|
||||
|
@ -9,12 +18,20 @@ define(['app'], function () {
|
|||
return defaultValue;
|
||||
}
|
||||
|
||||
return storeValue;
|
||||
return storeValue.toString();
|
||||
};
|
||||
|
||||
NzbDrone.Config.SetValue = function (key, value) {
|
||||
|
||||
console.log('Config: [{0}] => [{1}] '.format(key, value));
|
||||
|
||||
if (NzbDrone.Config.GetValue(key) === value.toString()) {
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem(key, value);
|
||||
NzbDrone.vent.trigger(NzbDrone.Config.Events.ConfigUpdatedEvent, {key: key, value: value});
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue