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.
29 lines
1.0 KiB
29 lines
1.0 KiB
using NzbDrone.Common.EnvironmentInfo;
|
|
using NzbDrone.Common.Extensions;
|
|
using NzbDrone.Core.Localization;
|
|
|
|
namespace NzbDrone.Core.HealthCheck.Checks
|
|
{
|
|
public class AppDataLocationCheck : HealthCheckBase
|
|
{
|
|
private readonly IAppFolderInfo _appFolderInfo;
|
|
|
|
public AppDataLocationCheck(IAppFolderInfo appFolderInfo, ILocalizationService localizationService)
|
|
: base(localizationService)
|
|
{
|
|
_appFolderInfo = appFolderInfo;
|
|
}
|
|
|
|
public override HealthCheck Check()
|
|
{
|
|
if (_appFolderInfo.StartUpFolder.IsParentPath(_appFolderInfo.AppDataFolder) ||
|
|
_appFolderInfo.StartUpFolder.PathEquals(_appFolderInfo.AppDataFolder))
|
|
{
|
|
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("AppDataLocationHealthCheckMessage"), "#updating-will-not-be-possible-to-prevent-deleting-appdata-on-update");
|
|
}
|
|
|
|
return new HealthCheck(GetType());
|
|
}
|
|
}
|
|
}
|