2013-02-20 18:33:05 -07:00
|
|
|
|
var AdvancedMetadataConfigurationPage = {
|
|
|
|
|
|
|
|
|
|
onPageShow: function () {
|
|
|
|
|
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2013-12-17 21:39:44 -07:00
|
|
|
|
ApiClient.getServerConfiguration().done(function (configuration) {
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2013-12-17 21:39:44 -07:00
|
|
|
|
AdvancedMetadataConfigurationPage.load(page, configuration);
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2013-12-17 21:39:44 -07:00
|
|
|
|
load: function (page, config) {
|
|
|
|
|
|
|
|
|
|
$('#chkEnableTmdbPersonUpdates', page).checked(config.EnableTmdbUpdates).checkboxradio("refresh");
|
|
|
|
|
$('#chkEnableTvdbUpdates', page).checked(config.EnableTvDbUpdates).checkboxradio("refresh");
|
2014-01-30 21:50:09 -07:00
|
|
|
|
$('#chkEnableFanartUpdates', page).checked(config.EnableFanArtUpdates).checkboxradio("refresh");
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onSubmit: function () {
|
|
|
|
|
var form = this;
|
|
|
|
|
|
2013-04-16 21:58:32 -07:00
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
2013-02-20 18:33:05 -07:00
|
|
|
|
ApiClient.getServerConfiguration().done(function (config) {
|
|
|
|
|
|
2013-12-17 21:39:44 -07:00
|
|
|
|
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
|
|
|
|
|
config.EnableTmdbUpdates = $('#chkEnableTmdbPersonUpdates', form).checked();
|
2014-01-30 21:50:09 -07:00
|
|
|
|
config.EnableFanArtUpdates = $('#chkEnableFanartUpdates', form).checked();
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2013-04-16 21:58:32 -07:00
|
|
|
|
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
2013-02-20 18:33:05 -07:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Disable default form submission
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$(document).on('pageshow', "#advancedMetadataConfigurationPage", AdvancedMetadataConfigurationPage.onPageShow);
|