New: Added health check to show a warning when MediaInfo is missing

pull/4/head
Keivan Beigi 10 years ago
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\ImportMechanismCheck.cs" />
<Compile Include="HealthCheck\Checks\IndexerCheck.cs" />
<Compile Include="HealthCheck\Checks\MediaInfoDllCheck.cs" />
<Compile Include="HealthCheck\Checks\MonoVersionCheck.cs" />
<Compile Include="HealthCheck\Checks\RootFolderCheck.cs" />
<Compile Include="HealthCheck\Checks\UpdateCheck.cs" />

Loading…
Cancel
Save