fix(sonarr): 🐛 Added some more error handling and information around testing sonarr

#4877
pull/4881/head^2
tidusjar 1 year ago
parent 29dc84e819
commit bd2c2d3901

@ -3,23 +3,6 @@ namespace Ombi.Api.Sonarr
public class SystemStatus
{
public string version { get; set; }
public string buildTime { get; set; }
public bool isDebug { get; set; }
public bool isProduction { get; set; }
public bool isAdmin { get; set; }
public bool isUserInteractive { get; set; }
public string startupPath { get; set; }
public string appData { get; set; }
public string osVersion { get; set; }
public bool isMonoRuntime { get; set; }
public bool isMono { get; set; }
public bool isLinux { get; set; }
public bool isOsx { get; set; }
public bool isWindows { get; set; }
public string branch { get; set; }
public string authentication { get; set; }
public string sqliteVersion { get; set; }
public string urlBase { get; set; }
public string runtimeVersion { get; set; }
}
}

@ -5,5 +5,6 @@
public bool IsValid { get; set; }
public string Version { get; set; }
public string ExpectedSubDir { get; set; }
public string AdditionalInformation { get; set; }
}
}

@ -2,4 +2,5 @@ export interface ITesterResult {
isValid: boolean;
version?: string;
expectedSubDir?: string;
additionalInformation?: string;
}

@ -220,7 +220,11 @@ export class SonarrComponent implements OnInit {
} 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!");
if (result.additionalInformation) {
this.notificationService.error(result.additionalInformation);
} else {
this.notificationService.error("We could not connect to Sonarr!");
}
}
});
}

@ -410,6 +410,30 @@ namespace Ombi.Controllers.V1.External
{
try
{
if (string.IsNullOrEmpty(settings.ApiKey))
{
return new TesterResultModel
{
IsValid = false,
AdditionalInformation = "NullApiKey"
};
}
if (string.IsNullOrEmpty(settings.Ip))
{
return new TesterResultModel
{
IsValid = false,
AdditionalInformation = "NullIp"
};
}
if (settings.Port <= 0)
{
return new TesterResultModel
{
IsValid = false,
AdditionalInformation = "BadPort"
};
}
var result = await SonarrApi.SystemStatus(settings.ApiKey, settings.FullUri);
return new TesterResultModel

Loading…
Cancel
Save