1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/scripts/wizardimagesettings.js
2014-07-02 01:16:59 -04:00

61 lines
1.7 KiB
JavaScript

(function ($, document) {
function save(page) {
Dashboard.showLoadingMsg();
ApiClient.ajax({
type: "POST",
url: ApiClient.getUrl("System/Configuration/VideoImageExtraction", { Enabled: $('#chkVideoImages', page).checked() })
}).done(function () {
// After saving chapter task, now save server config
ApiClient.getServerConfiguration().done(function (config) {
config.EnableUPnP = $('#chkEnableUpnp', page).checked();
ApiClient.updateServerConfiguration(config).done(function (result) {
ApiClient.getNamedConfiguration("chapters").done(function (chapterConfig) {
chapterConfig.EnableMovieChapterImageExtraction = $('#chkMovies', page).checked();
ApiClient.updateNamedConfiguration("chapters", chapterConfig).done(function () {
navigateToNextPage();
});
});
});
});
});
}
function navigateToNextPage() {
ApiClient.getSystemInfo().done(function (systemInfo) {
var os = systemInfo.OperatingSystem.toLowerCase();
if (os.indexOf('windows') != -1) {
Dashboard.navigate('wizardservice.html');
} else {
Dashboard.navigate('wizardfinish.html');
}
});
}
$(document).on('pageinit', "#wizardImageSettingsPage", function () {
var page = this;
$('#btnNextPage', page).on('click', function () {
save(page);
});
});
})(jQuery, document, window);