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

This commit is contained in:
Keivan Beigi 2014-10-13 10:36:51 -07:00
parent 019500ef4f
commit 1b6f684522
2 changed files with 33 additions and 0 deletions

View File

@ -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;
}
}
}
}

View File

@ -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" />