mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Merge branch 'master' of https://github.com/Jackett/Jackett
This commit is contained in:
@@ -62,6 +62,9 @@
|
|||||||
search:
|
search:
|
||||||
paths:
|
paths:
|
||||||
- path: torrents.php
|
- path: torrents.php
|
||||||
|
keywordsfilters:
|
||||||
|
- name: re_replace
|
||||||
|
args: ["S(\\d{2})E(\\d{2})", "$1 $2"]
|
||||||
inputs:
|
inputs:
|
||||||
search: "{{ .Keywords }}"
|
search: "{{ .Keywords }}"
|
||||||
category: "0"
|
category: "0"
|
||||||
|
@@ -10,7 +10,6 @@ using NLog;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using static Jackett.Common.Models.IndexerConfig.ConfigurationData;
|
using static Jackett.Common.Models.IndexerConfig.ConfigurationData;
|
||||||
@@ -177,10 +176,9 @@ namespace Jackett.Common.Indexers
|
|||||||
//TODO: Remove this section once users have moved off DPAPI
|
//TODO: Remove this section once users have moved off DPAPI
|
||||||
private bool MigratedFromDPAPI(JToken jsonConfig)
|
private bool MigratedFromDPAPI(JToken jsonConfig)
|
||||||
{
|
{
|
||||||
bool runningOnDotNetCore = RuntimeInformation.FrameworkDescription.IndexOf("core", StringComparison.OrdinalIgnoreCase) >= 0;
|
|
||||||
bool isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
|
bool isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
|
||||||
|
|
||||||
if (!isWindows && runningOnDotNetCore)
|
if (!isWindows && DotNetCoreUtil.IsRunningOnDotNetCore)
|
||||||
{
|
{
|
||||||
// User isn't running Windows, but is running on .NET Core framework, no access to the DPAPI, so don't bother trying to migrate
|
// User isn't running Windows, but is running on .NET Core framework, no access to the DPAPI, so don't bother trying to migrate
|
||||||
return false;
|
return false;
|
||||||
|
28
src/Jackett.Common/Utils/DotNetCoreUtil.cs
Normal file
28
src/Jackett.Common/Utils/DotNetCoreUtil.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Jackett.Common.Utils
|
||||||
|
{
|
||||||
|
public static class DotNetCoreUtil
|
||||||
|
{
|
||||||
|
public static bool IsRunningOnDotNetCore
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
bool runningOnDotNetCore = false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
runningOnDotNetCore = RuntimeInformation.FrameworkDescription.IndexOf("core", StringComparison.OrdinalIgnoreCase) >= 0;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
//Issue only appears to occur for small number of users on Mono
|
||||||
|
runningOnDotNetCore = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return runningOnDotNetCore;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -4,8 +4,6 @@ using Jackett.Common.Utils;
|
|||||||
using Jackett.Server.Services;
|
using Jackett.Server.Services;
|
||||||
using NLog;
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Jackett.Server
|
namespace Jackett.Server
|
||||||
{
|
{
|
||||||
@@ -113,8 +111,8 @@ namespace Jackett.Server
|
|||||||
{
|
{
|
||||||
logger.Info("Overriding port to " + consoleOptions.Port);
|
logger.Info("Overriding port to " + consoleOptions.Port);
|
||||||
serverConfig.Port = consoleOptions.Port;
|
serverConfig.Port = consoleOptions.Port;
|
||||||
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
|
||||||
if (isWindows)
|
if (EnvironmentUtil.IsWindows)
|
||||||
{
|
{
|
||||||
if (ServerUtil.IsUserAdministrator())
|
if (ServerUtil.IsUserAdministrator())
|
||||||
{
|
{
|
||||||
@@ -137,7 +135,7 @@ namespace Jackett.Server
|
|||||||
{
|
{
|
||||||
logger.Info("Overriding external access to " + consoleOptions.ListenPublic);
|
logger.Info("Overriding external access to " + consoleOptions.ListenPublic);
|
||||||
serverConfig.AllowExternal = consoleOptions.ListenPublic;
|
serverConfig.AllowExternal = consoleOptions.ListenPublic;
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
if (EnvironmentUtil.IsWindows)
|
||||||
{
|
{
|
||||||
if (ServerUtil.IsUserAdministrator())
|
if (ServerUtil.IsUserAdministrator())
|
||||||
{
|
{
|
||||||
|
@@ -47,9 +47,7 @@ namespace Jackett.Server
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(options.Client))
|
if (string.IsNullOrEmpty(options.Client))
|
||||||
{
|
{
|
||||||
bool runningOnDotNetCore = RuntimeInformation.FrameworkDescription.IndexOf("Core", StringComparison.OrdinalIgnoreCase) >= 0;
|
if (DotNetCoreUtil.IsRunningOnDotNetCore)
|
||||||
|
|
||||||
if (runningOnDotNetCore)
|
|
||||||
{
|
{
|
||||||
options.Client = "httpclientnetcore";
|
options.Client = "httpclientnetcore";
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using Jackett.Common.Models.Config;
|
using Jackett.Common.Models.Config;
|
||||||
using Jackett.Common.Services.Interfaces;
|
using Jackett.Common.Services.Interfaces;
|
||||||
|
using Jackett.Common.Utils;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.WebUtilities;
|
using Microsoft.AspNetCore.WebUtilities;
|
||||||
using NLog;
|
using NLog;
|
||||||
@@ -121,10 +122,8 @@ namespace Jackett.Server.Services
|
|||||||
logger.Error(e, "Error while reading the issue file");
|
logger.Error(e, "Error while reading the issue file");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool runningOnDotNetCore = RuntimeInformation.FrameworkDescription.IndexOf("Core", StringComparison.OrdinalIgnoreCase) >= 0;
|
|
||||||
|
|
||||||
Type monotype = Type.GetType("Mono.Runtime");
|
Type monotype = Type.GetType("Mono.Runtime");
|
||||||
if (monotype != null && !runningOnDotNetCore)
|
if (monotype != null && !DotNetCoreUtil.IsRunningOnDotNetCore)
|
||||||
{
|
{
|
||||||
MethodInfo displayName = monotype.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
|
MethodInfo displayName = monotype.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
|
||||||
var monoVersion = "unknown";
|
var monoVersion = "unknown";
|
||||||
|
Reference in New Issue
Block a user