|
|
@ -56,11 +56,20 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
|
|
|
|
|
|
|
_customerRequestBuilder = new HttpRequestBuilder(_acoustIdUrl).CreateFactory();
|
|
|
|
_customerRequestBuilder = new HttpRequestBuilder(_acoustIdUrl).CreateFactory();
|
|
|
|
|
|
|
|
|
|
|
|
_fpcalcPath = GetFpcalcPath();
|
|
|
|
// An exception here will cause Lidarr to fail to start, so catch any errors
|
|
|
|
if (_fpcalcPath.IsNotNullOrWhiteSpace())
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_fpcalcVersion = GetFpcalcVersion();
|
|
|
|
_fpcalcPath = GetFpcalcPath();
|
|
|
|
_fpcalcArgs = GetFpcalcArgs();
|
|
|
|
|
|
|
|
|
|
|
|
if (_fpcalcPath.IsNotNullOrWhiteSpace())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_fpcalcVersion = GetFpcalcVersion();
|
|
|
|
|
|
|
|
_fpcalcArgs = GetFpcalcArgs();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.Error(ex, "Somthing went wrong detecting fpcalc");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -77,17 +86,19 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
|
|
|
|
|
|
|
// check that the command exists
|
|
|
|
// check that the command exists
|
|
|
|
Process p = new Process();
|
|
|
|
Process p = new Process();
|
|
|
|
p.StartInfo.FileName = "which";
|
|
|
|
p.StartInfo.FileName = path;
|
|
|
|
p.StartInfo.Arguments = $"{path}";
|
|
|
|
p.StartInfo.Arguments = "-version";
|
|
|
|
p.StartInfo.UseShellExecute = false;
|
|
|
|
p.StartInfo.UseShellExecute = false;
|
|
|
|
p.StartInfo.RedirectStandardOutput = true;
|
|
|
|
p.StartInfo.RedirectStandardOutput = true;
|
|
|
|
|
|
|
|
|
|
|
|
p.Start();
|
|
|
|
try
|
|
|
|
// To avoid deadlocks, always read the output stream first and then wait.
|
|
|
|
{
|
|
|
|
string output = p.StandardOutput.ReadToEnd();
|
|
|
|
p.Start();
|
|
|
|
p.WaitForExit(1000);
|
|
|
|
// To avoid deadlocks, always read the output stream first and then wait.
|
|
|
|
|
|
|
|
string output = p.StandardOutput.ReadToEnd();
|
|
|
|
if (p.ExitCode != 0)
|
|
|
|
p.WaitForExit(1000);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Debug("fpcalc not found");
|
|
|
|
_logger.Debug("fpcalc not found");
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|