mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes #519 - Add third wizard page
This commit is contained in:
parent
0a849490b6
commit
3e69d637c4
7 changed files with 142 additions and 18 deletions
56
dashboard-ui/scripts/wizardsettings.js
Normal file
56
dashboard-ui/scripts/wizardsettings.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
(function ($, document) {
|
||||
|
||||
function save(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getScheduledTasks().done(function (tasks) {
|
||||
|
||||
var chapterTask = tasks.filter(function (t) {
|
||||
return t.Name.toLowerCase() == 'chapter image extraction';
|
||||
})[0];
|
||||
|
||||
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();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(function(result) {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult(result);
|
||||
|
||||
Dashboard.navigate('wizardfinish.html');
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#wizardSettingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnNextPage', page).on('click', function () {
|
||||
|
||||
save(page);
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
Loading…
Add table
Add a link
Reference in a new issue