mirror of https://github.com/lidarr/Lidarr
New: Added health check to show a warning when MediaInfo is missing
This commit is contained in:
parent
019500ef4f
commit
1b6f684522
|
@ -0,0 +1,32 @@
|
||||||
|
using System;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using MediaInfoLib;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.HealthCheck.Checks
|
||||||
|
{
|
||||||
|
public class MediaInfoDllCheck : HealthCheckBase
|
||||||
|
{
|
||||||
|
[MethodImpl(MethodImplOptions.NoOptimization)]
|
||||||
|
public override HealthCheck Check()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var mediaInfo = new MediaInfo();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return new HealthCheck(GetType(), HealthCheckResult.Warning, "MediaInfo could not be loaded " + e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new HealthCheck(GetType());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool CheckOnConfigChange
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -359,6 +359,7 @@
|
||||||
<Compile Include="HealthCheck\Checks\DroneFactoryCheck.cs" />
|
<Compile Include="HealthCheck\Checks\DroneFactoryCheck.cs" />
|
||||||
<Compile Include="HealthCheck\Checks\ImportMechanismCheck.cs" />
|
<Compile Include="HealthCheck\Checks\ImportMechanismCheck.cs" />
|
||||||
<Compile Include="HealthCheck\Checks\IndexerCheck.cs" />
|
<Compile Include="HealthCheck\Checks\IndexerCheck.cs" />
|
||||||
|
<Compile Include="HealthCheck\Checks\MediaInfoDllCheck.cs" />
|
||||||
<Compile Include="HealthCheck\Checks\MonoVersionCheck.cs" />
|
<Compile Include="HealthCheck\Checks\MonoVersionCheck.cs" />
|
||||||
<Compile Include="HealthCheck\Checks\RootFolderCheck.cs" />
|
<Compile Include="HealthCheck\Checks\RootFolderCheck.cs" />
|
||||||
<Compile Include="HealthCheck\Checks\UpdateCheck.cs" />
|
<Compile Include="HealthCheck\Checks\UpdateCheck.cs" />
|
||||||
|
|
Loading…
Reference in New Issue