jellyfin-web/dashboard-ui/scripts/appsettings.js
2015-05-28 01:51:48 -04:00

55 lines
1.4 KiB
JavaScript

(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;
},
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());
}
return store.getItem('enableItemPreviews') != 'false';
},
enableFullScreen: function (val) {
if (val != null) {
update('enableFullScreen', val.toString());
}
return store.getItem('enableFullScreen') == 'true';
}
};
})(window, window.appStorage);