You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/UI/Config.js

43 lines
1007 B

'use strict';
12 years ago
define(
[
'app'
], function () {
12 years ago
NzbDrone.Config = {
Events: {
ConfigUpdatedEvent: 'ConfigUpdatedEvent'
},
Keys : {
DefaultQualityProfileId: 'DefaultQualityProfileId'
}
};
12 years ago
NzbDrone.Config.GetValue = function (key, defaultValue) {
12 years ago
var storeValue = localStorage.getItem(key);
12 years ago
if (!storeValue) {
return defaultValue;
}
12 years ago
return storeValue.toString();
};
12 years ago
NzbDrone.Config.SetValue = function (key, value) {
12 years ago
console.log('Config: [{0}] => [{1}] '.format(key, value));
12 years ago
if (NzbDrone.Config.GetValue(key) === value.toString()) {
return;
}
12 years ago
localStorage.setItem(key, value);
NzbDrone.vent.trigger(NzbDrone.Config.Events.ConfigUpdatedEvent, {key: key, value: value});
12 years ago
};
12 years ago
return NzbDrone.Config;
});