Refactor of http client and addition of sonarr anime table
This commit is contained in:
@@ -32,6 +32,14 @@ const startFadeIn = (element, interval = 100) => {
|
||||
};
|
||||
|
||||
// Connection Methods
|
||||
const testConnectionSonarrAnime = async () => {
|
||||
var apiKeyElement = document.getElementById('SonarrAnimeAPIKey');
|
||||
var addressElement = document.getElementById('SonarrAnimeAddress');
|
||||
var validationElement = document.getElementById('SonarrAnimeConnectionValidation');
|
||||
|
||||
await validateConnection(apiKeyElement, addressElement, validationElement, "sonarr");
|
||||
}
|
||||
|
||||
const testConnectionSonarr = async () => {
|
||||
var apiKeyElement = document.getElementById('SonarrAPIKey');
|
||||
var addressElement = document.getElementById('SonarrAddress');
|
||||
@@ -131,6 +139,9 @@ document.querySelector('#RadarrTestConnectionButton')
|
||||
document.querySelector('#SonarrTestConnectionButton')
|
||||
.addEventListener('click', testConnectionSonarr);
|
||||
|
||||
document.querySelector('#SonarrAnimeTestConnectionButton')
|
||||
.addEventListener('click', testConnectionSonarrAnime);
|
||||
|
||||
document.querySelector('#MediaCleanerConfigPage')
|
||||
.addEventListener('pageshow', function() {
|
||||
Dashboard.showLoadingMsg();
|
||||
@@ -139,6 +150,8 @@ document.querySelector('#MediaCleanerConfigPage')
|
||||
document.querySelector('#RadarrAddress').value = config.RadarrAddress;
|
||||
document.querySelector('#SonarrAPIKey').value = config.SonarrAPIKey;
|
||||
document.querySelector('#SonarrAddress').value = config.SonarrAddress;
|
||||
document.querySelector('#SonarrAnimeAPIKey').value = config.SonarrAnimeAPIKey;
|
||||
document.querySelector('#SonarrAnimeAddress').value = config.SonarrAnimeAddress;
|
||||
document.querySelector('#StaleMediaCutoff').value = config.StaleMediaCutoff;
|
||||
document.querySelector('#DebugMode').checked = config.DebugMode;
|
||||
Dashboard.hideLoadingMsg();
|
||||
@@ -153,6 +166,8 @@ document.querySelector('#MediaCleanerConfigForm')
|
||||
config.RadarrAddress = document.querySelector('#RadarrAddress').value;
|
||||
config.SonarrAPIKey = document.querySelector('#SonarrAPIKey').value;
|
||||
config.SonarrAddress = document.querySelector('#SonarrAddress').value;
|
||||
config.SonarrAnimeAPIKey = document.querySelector('#SonarrAnimeAPIKey').value;
|
||||
config.SonarrAnimeAddress = document.querySelector('#SonarrAnimeAddress').value;
|
||||
config.StaleMediaCutoff = document.querySelector('#StaleMediaCutoff').value;
|
||||
config.DebugMode = document.querySelector('#DebugMode').checked;
|
||||
ApiClient.updatePluginConfiguration(MediaCleanerConfig.pluginUniqueId, config).then(function (result) {
|
||||
|
||||
Reference in New Issue
Block a user