From f94f4ac1c0caf92ea7486460305c6ef074a607d9 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 17 Feb 2021 08:21:47 +0000 Subject: [PATCH] Fixed an issue with the test buttons on the *arr components not working correctly --- .../ClientApp/src/app/settings/lidarr/lidarr.component.ts | 2 +- .../ClientApp/src/app/settings/radarr/radarr.component.ts | 2 +- .../ClientApp/src/app/settings/sonarr/sonarr.component.ts | 2 +- src/Ombi/Controllers/V1/External/TesterController.cs | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/settings/lidarr/lidarr.component.ts b/src/Ombi/ClientApp/src/app/settings/lidarr/lidarr.component.ts index 5d8667db4..80420fc15 100644 --- a/src/Ombi/ClientApp/src/app/settings/lidarr/lidarr.component.ts +++ b/src/Ombi/ClientApp/src/app/settings/lidarr/lidarr.component.ts @@ -109,7 +109,7 @@ export class LidarrComponent implements OnInit { this.testerService.lidarrTest(settings).subscribe(result => { if (result.isValid) { this.notificationService.success("Successfully connected to Lidarr!"); - } else if (result.expectedSubDir !== null) { + } else if (result.expectedSubDir) { this.notificationService.error("Your Lidarr Base URL must be set to " + result.expectedSubDir); } else { this.notificationService.error("We could not connect to Lidarr!"); diff --git a/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts b/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts index df804a08c..d4c5a9883 100644 --- a/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts +++ b/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts @@ -99,7 +99,7 @@ export class RadarrComponent implements OnInit { this.testerService.radarrTest(settings).subscribe(result => { if (result.isValid) { this.notificationService.success("Successfully connected to Radarr!"); - } else if (result.expectedSubDir !== null) { + } else if (result.expectedSubDir) { this.notificationService.error("Your Radarr Base URL must be set to " + result.expectedSubDir); } else { this.notificationService.error("We could not connect to Radarr!"); diff --git a/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.ts b/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.ts index edd22bbdd..09f86859a 100644 --- a/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.ts +++ b/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.ts @@ -153,7 +153,7 @@ export class SonarrComponent implements OnInit { this.testerService.sonarrTest(settings).subscribe(result => { if (result.isValid) { this.notificationService.success("Successfully connected to Sonarr!"); - } else if (result.expectedSubDir !== null) { + } else if (result.expectedSubDir) { this.notificationService.error("Your Sonarr Base URL must be set to " + result.expectedSubDir); } else { this.notificationService.error("We could not connect to Sonarr!"); diff --git a/src/Ombi/Controllers/V1/External/TesterController.cs b/src/Ombi/Controllers/V1/External/TesterController.cs index 82182c012..7b9540a55 100644 --- a/src/Ombi/Controllers/V1/External/TesterController.cs +++ b/src/Ombi/Controllers/V1/External/TesterController.cs @@ -374,7 +374,7 @@ namespace Ombi.Controllers.V1.External var result = await RadarrApi.SystemStatus(settings.ApiKey, settings.FullUri); return new TesterResultModel { - IsValid = result.urlBase == settings.SubDir, + IsValid = result.urlBase == settings.SubDir || string.IsNullOrEmpty(result.urlBase) && string.IsNullOrEmpty(settings.SubDir), ExpectedSubDir = result.urlBase }; } @@ -399,7 +399,7 @@ namespace Ombi.Controllers.V1.External var result = await SonarrApi.SystemStatus(settings.ApiKey, settings.FullUri); return new TesterResultModel { - IsValid = result.urlBase == settings.SubDir, + IsValid = result.urlBase == settings.SubDir || string.IsNullOrEmpty(result.urlBase) && string.IsNullOrEmpty(settings.SubDir), ExpectedSubDir = result.urlBase }; } @@ -513,7 +513,7 @@ namespace Ombi.Controllers.V1.External var status = await LidarrApi.Status(settings.ApiKey, settings.FullUri); return new TesterResultModel { - IsValid = status?.urlBase == settings.SubDir, + IsValid = status?.urlBase == settings.SubDir || string.IsNullOrEmpty(result.urlBase) && string.IsNullOrEmpty(settings.SubDir), ExpectedSubDir = status?.urlBase }; }