2015-05-27 22:51:48 -07:00
|
|
|
|
(function (window, store) {
|
|
|
|
|
|
|
|
|
|
function update(key, val) {
|
|
|
|
|
store.setItem(key, val);
|
|
|
|
|
|
|
|
|
|
Events.trigger(AppSettings, 'settingupdated', [key]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.AppSettings = {
|
|
|
|
|
|
|
|
|
|
maxStreamingBitrate: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('preferredVideoBitrate', val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return parseInt(store.getItem('preferredVideoBitrate') || '') || 1500000;
|
|
|
|
|
},
|
|
|
|
|
maxChromecastBitrate: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('chromecastBitrate', val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return parseInt(store.getItem('chromecastBitrate') || '') || 3000000;
|
|
|
|
|
},
|
2015-06-07 20:16:42 -07:00
|
|
|
|
enableChromecastAc3: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('enablechromecastac3', val.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return store.getItem('enablechromecastac3') == 'true';
|
|
|
|
|
},
|
2015-05-27 22:51:48 -07:00
|
|
|
|
enableExternalPlayers: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('externalplayers', val.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return store.getItem('externalplayers') == 'true';
|
|
|
|
|
},
|
|
|
|
|
enableItemPreviews: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('enableItemPreviews', val.toString());
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-07 14:21:30 -07:00
|
|
|
|
return store.getItem('enableItemPreviews') == 'true';
|
2015-05-27 22:51:48 -07:00
|
|
|
|
},
|
|
|
|
|
enableFullScreen: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('enableFullScreen', val.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return store.getItem('enableFullScreen') == 'true';
|
2015-06-09 21:01:14 -07:00
|
|
|
|
},
|
|
|
|
|
syncPath: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('syncPath', val.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return store.getItem('syncPath');
|
2015-05-27 22:51:48 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})(window, window.appStorage);
|