1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Remove mono process detection

(cherry picked from commit 5a046026725084bc880a7b63d7105dcf4d882128)
This commit is contained in:
Qstick 2023-04-16 17:58:26 -05:00
parent 2b4d6464e2
commit 1be450a9d0

View File

@ -320,7 +320,7 @@ private ProcessInfo ConvertToProcessInfo(Process process)
processInfo = new ProcessInfo(); processInfo = new ProcessInfo();
processInfo.Id = process.Id; processInfo.Id = process.Id;
processInfo.Name = process.ProcessName; processInfo.Name = process.ProcessName;
processInfo.StartPath = GetExeFileName(process); processInfo.StartPath = process.MainModule.FileName;
if (process.Id != GetCurrentProcessId() && process.HasExited) if (process.Id != GetCurrentProcessId() && process.HasExited)
{ {
@ -335,16 +335,6 @@ private ProcessInfo ConvertToProcessInfo(Process process)
return processInfo; return processInfo;
} }
private static string GetExeFileName(Process process)
{
if (process.MainModule.FileName != "mono.exe")
{
return process.MainModule.FileName;
}
return process.Modules.Cast<ProcessModule>().FirstOrDefault(module => module.ModuleName.ToLower().EndsWith(".exe")).FileName;
}
private List<Process> GetProcessesByName(string name) private List<Process> GetProcessesByName(string name)
{ {
var processes = Process.GetProcessesByName(name).ToList(); var processes = Process.GetProcessesByName(name).ToList();