mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
live tv updates
This commit is contained in:
parent
0b9f6ce000
commit
9ac1ae7f6b
10 changed files with 117 additions and 99 deletions
|
@ -4,70 +4,103 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getScheduledTasks().done(function (tasks) {
|
||||
// After saving chapter task, now save server config
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
var chapterTask = tasks.filter(function (t) {
|
||||
return t.Name.toLowerCase() == 'chapter image extraction';
|
||||
})[0];
|
||||
config.SaveLocalMeta = $('#chkSaveLocalMetadata', page).checked();
|
||||
config.PreferredMetadataLanguage = $('#selectLanguage', page).val();
|
||||
config.MetadataCountryCode = $('#selectCountry', page).val();
|
||||
|
||||
if (!chapterTask) {
|
||||
throw new Error('Cannot find chapter scheduled task');
|
||||
}
|
||||
|
||||
// First update the chapters scheduled task
|
||||
var triggers = $('#chkChapters', page).checked() ? [{
|
||||
"Type": "DailyTrigger",
|
||||
"TimeOfDayTicks": 144000000000
|
||||
}] : [];
|
||||
|
||||
ApiClient.updateScheduledTaskTriggers(chapterTask.Id, triggers).done(function () {
|
||||
|
||||
|
||||
// After saving chapter task, now save server config
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.SaveLocalMeta = $('#chkSaveLocalMetadata', page).checked();
|
||||
config.EnableVideoImageExtraction = $('#chkVIdeoImages', page).checked();
|
||||
config.ImageSavingConvention = $('#selectImageSavingConvention', page).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(function (result) {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult(result);
|
||||
|
||||
navigateToNextPage();
|
||||
|
||||
});
|
||||
});
|
||||
ApiClient.updateServerConfiguration(config).done(function (result) {
|
||||
|
||||
navigateToNextPage();
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function navigateToNextPage() {
|
||||
function populateCountries(page, allCountries) {
|
||||
|
||||
ApiClient.getSystemInfo().done(function (systemInfo) {
|
||||
var html = "";
|
||||
|
||||
var os = systemInfo.OperatingSystem.toLowerCase();
|
||||
html += "<option value=''></option>";
|
||||
|
||||
if (os.indexOf('windows') != -1) {
|
||||
Dashboard.navigate('wizardservice.html');
|
||||
} else {
|
||||
Dashboard.navigate('wizardfinish.html');
|
||||
}
|
||||
for (var i = 0, length = allCountries.length; i < length; i++) {
|
||||
|
||||
var culture = allCountries[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISORegionName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
$('#selectCountry', page).html(html).selectmenu("refresh");
|
||||
}
|
||||
|
||||
function populateLanguages(page, allCultures) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = allCultures.length; i < length; i++) {
|
||||
|
||||
var culture = allCultures[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISOLanguageName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
$('#selectLanguage', page).html(html).selectmenu("refresh");
|
||||
}
|
||||
|
||||
function reloadData(page, config, cultures, countries) {
|
||||
|
||||
populateLanguages(page, cultures);
|
||||
populateCountries(page, countries);
|
||||
|
||||
$('#selectLanguage', page).val(config.PreferredMetadataLanguage).selectmenu("refresh");
|
||||
$('#selectCountry', page).val(config.MetadataCountryCode).selectmenu("refresh");
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var promise1 = ApiClient.getServerConfiguration();
|
||||
var promise2 = ApiClient.getCultures();
|
||||
var promise3 = ApiClient.getCountries();
|
||||
|
||||
$.when(promise1, promise2, promise3).done(function (response1, response2, response3) {
|
||||
|
||||
reloadData(page, response1[0], response2[0], response3[0]);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#wizardSettingsPage", function () {
|
||||
function navigateToNextPage() {
|
||||
|
||||
Dashboard.navigate('wizardimagesettings.html');
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#wizardSettingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnNextPage', page).on('click', function () {
|
||||
|
||||
save(page);
|
||||
});
|
||||
reload(page);
|
||||
});
|
||||
|
||||
window.WizardSettingsPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
|
||||
var form = this;
|
||||
|
||||
save(form);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue