You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
889 B
28 lines
889 B
using NzbDrone.Common.EnvironmentInfo;
|
|
using NzbDrone.Common.Extensions;
|
|
using NzbDrone.Core.Configuration.Events;
|
|
|
|
namespace NzbDrone.Core.HealthCheck.Checks
|
|
{
|
|
public class AppDataLocationCheck : HealthCheckBase
|
|
{
|
|
private readonly IAppFolderInfo _appFolderInfo;
|
|
|
|
public AppDataLocationCheck(IAppFolderInfo appFolderInfo)
|
|
{
|
|
_appFolderInfo = appFolderInfo;
|
|
}
|
|
|
|
public override HealthCheck Check()
|
|
{
|
|
if (_appFolderInfo.StartUpFolder.IsParentPath(_appFolderInfo.AppDataFolder) ||
|
|
_appFolderInfo.StartUpFolder.PathEquals(_appFolderInfo.AppDataFolder))
|
|
{
|
|
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Updating will not be possible to prevent deleting AppData on Update");
|
|
}
|
|
|
|
return new HealthCheck(GetType());
|
|
}
|
|
}
|
|
}
|