mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
fix(sonarr): 🐛 Added some more error handling and information around testing sonarr
#4877
This commit is contained in:
parent
29dc84e819
commit
bd2c2d3901
5 changed files with 31 additions and 18 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue