mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 17:13:49 -07:00
broken
This commit is contained in:
parent
0916c8b8d1
commit
24c77b4047
29 changed files with 610 additions and 517 deletions
55
UI/Config.js
55
UI/Config.js
|
@ -1,37 +1,42 @@
|
|||
"use strict";
|
||||
define(['app'], function () {
|
||||
define(
|
||||
[
|
||||
'app'
|
||||
], function () {
|
||||
|
||||
NzbDrone.Config = {
|
||||
Events: {
|
||||
ConfigUpdatedEvent: 'ConfigUpdatedEvent'
|
||||
},
|
||||
Keys : {
|
||||
DefaultQualityProfileId: 'DefaultQualityProfileId'
|
||||
}
|
||||
};
|
||||
NzbDrone.Config = {
|
||||
Events: {
|
||||
ConfigUpdatedEvent: 'ConfigUpdatedEvent'
|
||||
},
|
||||
Keys : {
|
||||
DefaultQualityProfileId: 'DefaultQualityProfileId'
|
||||
}
|
||||
};
|
||||
|
||||
NzbDrone.Config.GetValue = function (key, defaultValue) {
|
||||
NzbDrone.Config.GetValue = function (key, defaultValue) {
|
||||
|
||||
var storeValue = localStorage.getItem(key);
|
||||
var storeValue = localStorage.getItem(key);
|
||||
|
||||
if (!storeValue) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (!storeValue) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return storeValue.toString();
|
||||
};
|
||||
return storeValue.toString();
|
||||
};
|
||||
|
||||
NzbDrone.Config.SetValue = function (key, value) {
|
||||
NzbDrone.Config.SetValue = function (key, value) {
|
||||
|
||||
console.log('Config: [{0}] => [{1}] '.format(key, value));
|
||||
console.log('Config: [{0}] => [{1}] '.format(key, value));
|
||||
|
||||
if (NzbDrone.Config.GetValue(key) === value.toString()) {
|
||||
return;
|
||||
}
|
||||
if (NzbDrone.Config.GetValue(key) === value.toString()) {
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem(key, value);
|
||||
NzbDrone.vent.trigger(NzbDrone.Config.Events.ConfigUpdatedEvent, {key: key, value: value});
|
||||
localStorage.setItem(key, value);
|
||||
NzbDrone.vent.trigger(NzbDrone.Config.Events.ConfigUpdatedEvent, {key: key, value: value});
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
});
|
||||
return NzbDrone.Config;
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue