fix built in plugin js

This commit is contained in:
crobibero 2020-07-20 17:23:36 -06:00
parent 0750357916
commit f4cafc2f31
3 changed files with 14 additions and 15 deletions

View File

@ -31,8 +31,8 @@
$('.configPage').on('pageshow', function () { $('.configPage').on('pageshow', function () {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) { ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
$('#enable').checked = config.Enable; document.querySelector('#enable').checked = config.Enable;
$('#replaceAlbumName').checked = config.ReplaceAlbumName; document.querySelector('#replaceAlbumName').checked = config.ReplaceAlbumName;
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
@ -43,8 +43,8 @@
var form = this; var form = this;
ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) { ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
config.Enable = $('#enable', form).checked; config.Enable = document.querySelector('#enable').checked;
config.ReplaceAlbumName = $('#replaceAlbumName', form).checked; config.ReplaceAlbumName = document.querySelector('#replaceAlbumName').checked;
ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult); ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
}); });

View File

@ -39,10 +39,10 @@
$('.musicBrainzConfigPage').on('pageshow', function () { $('.musicBrainzConfigPage').on('pageshow', function () {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(MusicBrainzPluginConfig.uniquePluginId).then(function (config) { ApiClient.getPluginConfiguration(MusicBrainzPluginConfig.uniquePluginId).then(function (config) {
$('#server').val(config.Server).change(); document.querySelector('#server').value = config.Server;
$('#rateLimit').val(config.RateLimit).change(); document.querySelector('#rateLimit').value = config.RateLimit;
$('#enable').checked = config.Enable; document.querySelector('#enable').checked = config.Enable;
$('#replaceArtistName').checked = config.ReplaceArtistName; document.querySelector('#replaceArtistName').checked = config.ReplaceArtistName;
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
@ -51,12 +51,11 @@
$('.musicBrainzConfigForm').on('submit', function (e) { $('.musicBrainzConfigForm').on('submit', function (e) {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
var form = this;
ApiClient.getPluginConfiguration(MusicBrainzPluginConfig.uniquePluginId).then(function (config) { ApiClient.getPluginConfiguration(MusicBrainzPluginConfig.uniquePluginId).then(function (config) {
config.Server = $('#server', form).val(); config.Server = document.querySelector('#server').value;
config.RateLimit = $('#rateLimit', form).val(); config.RateLimit = document.querySelector('#rateLimit').value;
config.Enable = $('#enable', form).checked; config.Enable = document.querySelector('#enable').checked;
config.ReplaceArtistName = $('#replaceArtistName', form).checked; config.ReplaceArtistName = document.querySelector('#replaceArtistName').checked;
ApiClient.updatePluginConfiguration(MusicBrainzPluginConfig.uniquePluginId, config).then(Dashboard.processPluginConfigurationUpdateResult); ApiClient.updatePluginConfiguration(MusicBrainzPluginConfig.uniquePluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
}); });

View File

@ -27,7 +27,7 @@
$('.configPage').on('pageshow', function () { $('.configPage').on('pageshow', function () {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) { ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
$('#castAndCrew').checked = config.CastAndCrew; document.querySelector('#castAndCrew').checked = config.CastAndCrew;
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
}); });
@ -37,7 +37,7 @@
var form = this; var form = this;
ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) { ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
config.CastAndCrew = $('#castAndCrew', form).checked; config.CastAndCrew = document.querySelector('#castAndCrew', form).checked;
ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult); ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
}); });