|
|
|
@ -36,32 +36,35 @@
|
|
|
|
|
uniquePluginId: "8c95c4d2-e50c-4fb0-a4f3-6c06ff0f9a1a"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$('.musicBrainzConfigPage').on('pageshow', function () {
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
ApiClient.getPluginConfiguration(MusicBrainzPluginConfig.uniquePluginId).then(function (config) {
|
|
|
|
|
document.querySelector('#server').value = config.Server;
|
|
|
|
|
document.querySelector('#rateLimit').value = config.RateLimit;
|
|
|
|
|
document.querySelector('#enable').checked = config.Enable;
|
|
|
|
|
document.querySelector('#replaceArtistName').checked = config.ReplaceArtistName;
|
|
|
|
|
document.querySelector('.musicBrainzConfigPage')
|
|
|
|
|
.addEventListener('pageshow', function () {
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
ApiClient.getPluginConfiguration(MusicBrainzPluginConfig.uniquePluginId).then(function (config) {
|
|
|
|
|
document.querySelector('#server').value = config.Server;
|
|
|
|
|
document.querySelector('#rateLimit').value = config.RateLimit;
|
|
|
|
|
document.querySelector('#enable').checked = config.Enable;
|
|
|
|
|
document.querySelector('#replaceArtistName').checked = config.ReplaceArtistName;
|
|
|
|
|
|
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('.musicBrainzConfigForm').on('submit', function (e) {
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
document.querySelector('.musicBrainzConfigForm')
|
|
|
|
|
.addEventListener('submit', function (e) {
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
|
|
|
|
ApiClient.getPluginConfiguration(MusicBrainzPluginConfig.uniquePluginId).then(function (config) {
|
|
|
|
|
config.Server = document.querySelector('#server').value;
|
|
|
|
|
config.RateLimit = document.querySelector('#rateLimit').value;
|
|
|
|
|
config.Enable = document.querySelector('#enable').checked;
|
|
|
|
|
config.ReplaceArtistName = document.querySelector('#replaceArtistName').checked;
|
|
|
|
|
ApiClient.getPluginConfiguration(MusicBrainzPluginConfig.uniquePluginId).then(function (config) {
|
|
|
|
|
config.Server = document.querySelector('#server').value;
|
|
|
|
|
config.RateLimit = document.querySelector('#rateLimit').value;
|
|
|
|
|
config.Enable = document.querySelector('#enable').checked;
|
|
|
|
|
config.ReplaceArtistName = document.querySelector('#replaceArtistName').checked;
|
|
|
|
|
|
|
|
|
|
ApiClient.updatePluginConfiguration(MusicBrainzPluginConfig.uniquePluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
|
|
|
|
|
});
|
|
|
|
|
ApiClient.updatePluginConfiguration(MusicBrainzPluginConfig.uniquePluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|