mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add cinema mode feature
This commit is contained in:
parent
42f0520499
commit
f03d5f6fd2
28 changed files with 327 additions and 89 deletions
61
dashboard-ui/scripts/metadatakodi.js
Normal file
61
dashboard-ui/scripts/metadatakodi.js
Normal file
|
@ -0,0 +1,61 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
var metadataKey = "xbmcmetadata";
|
||||
|
||||
function loadPage(page, config, users) {
|
||||
|
||||
var html = '<option value="" selected="selected"></option>';
|
||||
|
||||
html += users.map(function (user) {
|
||||
return '<option value="' + user.Id + '">' + user.Name + '</option>';
|
||||
}).join('');
|
||||
|
||||
$('#selectUser', page).html(html).val(config.UserId || '').selectmenu('refresh');
|
||||
$('#selectReleaseDateFormat', page).val(config.ReleaseDateFormat).selectmenu('refresh');
|
||||
$('#chkSaveImagePaths', page).checked(config.SaveImagePathsInNfo).checkboxradio('refresh');
|
||||
$('#chkEnablePathSubstitution', page).checked(config.EnablePathSubstitution).checkboxradio('refresh');
|
||||
$('#chkEnableExtraThumbs', page).checked(config.EnableExtraThumbsDuplication).checkboxradio('refresh');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#metadataKodiPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
var promise1 = ApiClient.getUsers();
|
||||
var promise2 = ApiClient.getNamedConfiguration(metadataKey);
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
|
||||
loadPage(page, response2[0], response1[0]);
|
||||
});
|
||||
});
|
||||
|
||||
window.KodiMetadataPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getNamedConfiguration(metadataKey).done(function (config) {
|
||||
|
||||
config.UserId = $('#selectUser', form).val() || null;
|
||||
config.ReleaseDateFormat = $('#selectReleaseDateFormat', form).val();
|
||||
config.SaveImagePathsInNfo = $('#chkSaveImagePaths', form).checked();
|
||||
config.EnablePathSubstitution = $('#chkEnablePathSubstitution', form).checked();
|
||||
config.EnableExtraThumbsDuplication = $('#chkEnableExtraThumbs', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration(metadataKey, config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, document, window);
|
Loading…
Add table
Add a link
Reference in a new issue