returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Remote download client {client.Definition.Name} places downloads in {folder.FullPath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.","#bad-remote-path-mapping");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"You are using docker; download client {client.Definition.Name} places downloads in {folder.FullPath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.","#docker-bad-remote-path-mapping");
}
else
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Local download client {client.Definition.Name} places downloads in {folder.FullPath} but this is not a valid {_osInfo.Name} path. Review your download client settings.","#bad-download-client-settings");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"You are using docker; download client {client.Definition.Name} places downloads in {folder.FullPath} but this directory does not appear to exist inside the container. Review your remote path mappings and container volume settings.","#docker-bad-remote-path-mapping");
}
elseif(!status.IsLocalhost)
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Remote download client {client.Definition.Name} places downloads in {folder.FullPath} but this directory does not appear to exist. Likely missing or incorrect remote path mapping.","#bad-remote-path-mapping");
}
else
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Download client {client.Definition.Name} places downloads in {folder.FullPath} but Lidarr cannot see this directory. You may need to adjust the folder's permissions.","#permissions-error");
// if we can see the file exists but the import failed then likely a permissions issue
if(failureMessage.TrackInfo!=null)
{
vartrackPath=failureMessage.TrackInfo.Path;
if(_diskProvider.FileExists(trackPath))
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Lidarr can see but not access downloaded track {trackPath}. Likely permissions error.","#permissions-error");
}
else
{
// If the file doesn't exist but TrackInfo is not null then the message is coming from
// ImportApprovedTracks and the file must have been removed part way through processing
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"File {trackPath} was removed part way though procesing.");
}
}
// If the previous case did not match then the failure occured in DownloadedTracksImportService,
// while trying to locate the files reported by the download client
// If dlpath is null then there's not much useful we can report. Give a generic message so
// that the user realises something is wrong.
if(dlpath.IsNullOrWhiteSpace())
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Lidarr failed to import a track. Check your logs for details.");
}
if(!dlpath.IsPathValid())
{
if(!status.IsLocalhost)
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Remote download client {client.Definition.Name} reported files in {dlpath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.","#bad-remote-path-mapping");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"You are using docker; download client {client.Definition.Name} reported files in {dlpath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.","#docker-bad-remote-path-mapping");
}
else
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Local download client {client.Definition.Name} reported files in {dlpath} but this is not a valid {_osInfo.Name} path. Review your download client settings.","#bad-download-client-settings");
}
}
if(_diskProvider.FolderExists(dlpath))
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Lidarr can see but not access download directory {dlpath}. Likely permissions error.","#permissions-error");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"You are using docker; download client {client.Definition.Name} reported files in {dlpath} but this directory does not appear to exist inside the container. Review your remote path mappings and container volume settings.","#docker-bad-remote-path-mapping");
}
elseif(!status.IsLocalhost)
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Remote download client {client.Definition.Name} reported files in {dlpath} but this directory does not appear to exist. Likely missing remote path mapping.","#bad-remote-path-mapping");
}
else
{
// path mappings shouldn't be needed locally so probably a permissions issue
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Download client {client.Definition.Name} reported files in {dlpath} but Lidarr cannot see this directory. You may need to adjust the folder's permissions.","#permissions-error");