From 4b599f391cf17121c573f93b7ee21cd4bc79edb8 Mon Sep 17 00:00:00 2001 From: flightlevel Date: Tue, 5 Jun 2018 21:47:13 +1000 Subject: [PATCH] Mono 5.8 is the minimum supported runtime #3181 fix. Can get away without using RuntimeInformation and didn't consider public trackers without a password --- README.md | 2 +- src/Jackett.Common/Indexers/BaseIndexer.cs | 15 +++------------ src/Jackett/Services/ServerService.cs | 4 ++-- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 2c2feb060..625a1ddf1 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Developer note: The software implements the [Torznab](https://github.com/Sonarr/ #### Supported Systems * Windows using .NET 4.6.1 or above [Download here](https://www.microsoft.com/net/framework/versions/net461). -* Linux and macOS using Mono 5.4.0 and above. [Download here](http://www.mono-project.com/download/). Earlier versions of mono may work, but some trackers may fail to negotiate SSL correctly, and others may cause Jackett to crash when used. +* Linux and macOS using Mono 5.8 or above. [Download here](http://www.mono-project.com/download/). Earlier versions of mono may work, but some trackers may fail to negotiate SSL correctly, and others may cause Jackett to crash when used. ### Supported Public Trackers * 1337x diff --git a/src/Jackett.Common/Indexers/BaseIndexer.cs b/src/Jackett.Common/Indexers/BaseIndexer.cs index cee18bd41..bc57c7a6c 100644 --- a/src/Jackett.Common/Indexers/BaseIndexer.cs +++ b/src/Jackett.Common/Indexers/BaseIndexer.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; -using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using AutoMapper; @@ -190,15 +189,7 @@ namespace Jackett.Common.Indexers } Version dotNetVersion = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.RuntimeFramework.Version; - bool isWindows = false; - try { - // RuntimeInformation not available on older mono versions? - isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - } - catch (Exception e) - { - logger.Error(e, "IsOSPlatform check failed, assuming no windows system"); - } + bool isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT; if (!isWindows && dotNetVersion.Major < 4) { @@ -216,9 +207,9 @@ namespace Jackett.Common.Indexers passwordPropertyValue = configData.GetType().GetProperty("Password").GetValue(configData, null); passwordValue = passwordPropertyValue.GetType().GetProperty("Value").GetValue(passwordPropertyValue, null).ToString(); } - catch (Exception ex) + catch (Exception) { - logger.Info("Attempt to source password from json failed: " + ex.ToString()); + logger.Debug($"Unable to source password for [{ID}] while attempting migration, likely a public tracker"); return false; } diff --git a/src/Jackett/Services/ServerService.cs b/src/Jackett/Services/ServerService.cs index e16de8415..3eb677477 100644 --- a/src/Jackett/Services/ServerService.cs +++ b/src/Jackett/Services/ServerService.cs @@ -153,9 +153,9 @@ namespace Jackett.Services logger.Error(notice); } - if (monoVersionO.Major < 5 || (monoVersionO.Major == 5 && monoVersionO.Minor < 4)) + if (monoVersionO.Major < 5 || (monoVersionO.Major == 5 && monoVersionO.Minor < 8)) { - string notice = "Mono version 5.4 is the minimum required. Please update to the latest version from http://www.mono-project.com/download/"; + string notice = "A minimum Mono version of 5.8 is required. Please update to the latest version from http://www.mono-project.com/download/"; _notices.Add(notice); logger.Error(notice); }