Private GIT

Skip to content
Snippets Groups Projects
Commit dd06d093 authored by kaso17's avatar kaso17 Committed by vlbox
Browse files

add --NoUpdates option

parent 28e39be7
No related merge requests found
...@@ -69,6 +69,9 @@ namespace Jackett.Common.Models.Config ...@@ -69,6 +69,9 @@ namespace Jackett.Common.Models.Config
[Option("PIDFile", HelpText = "Specify the location of PID file")] [Option("PIDFile", HelpText = "Specify the location of PID file")]
public string PIDFile { get; set; } public string PIDFile { get; set; }
[Option("NoUpdates", HelpText = "Disable automatic updates")]
public bool NoUpdates { get; set; }
public RuntimeSettings ToRunTimeSettings() public RuntimeSettings ToRunTimeSettings()
{ {
var options = this; var options = this;
...@@ -102,6 +105,7 @@ namespace Jackett.Common.Models.Config ...@@ -102,6 +105,7 @@ namespace Jackett.Common.Models.Config
// Ignore SSL errors on Curl // Ignore SSL errors on Curl
runtimeSettings.IgnoreSslErrors = options.IgnoreSslErrors; runtimeSettings.IgnoreSslErrors = options.IgnoreSslErrors;
runtimeSettings.NoRestart = options.NoRestart; runtimeSettings.NoRestart = options.NoRestart;
runtimeSettings.NoUpdates = options.NoUpdates;
if (!string.IsNullOrWhiteSpace(options.DataFolder)) if (!string.IsNullOrWhiteSpace(options.DataFolder))
runtimeSettings.CustomDataFolder = options.DataFolder; runtimeSettings.CustomDataFolder = options.DataFolder;
......
...@@ -29,6 +29,8 @@ namespace Jackett.Common.Models.Config ...@@ -29,6 +29,8 @@ namespace Jackett.Common.Models.Config
public string PIDFile { get; set; } public string PIDFile { get; set; }
public bool NoUpdates { get; set; }
public string DataFolder public string DataFolder
{ {
......
...@@ -75,6 +75,11 @@ namespace Jackett.Services ...@@ -75,6 +75,11 @@ namespace Jackett.Services
private async Task CheckForUpdates() private async Task CheckForUpdates()
{ {
var config = Engine.ServerConfig; var config = Engine.ServerConfig;
if (config.RuntimeSettings.NoUpdates)
{
logger.Info($"Updates are disabled via --NoUpdates.");
return;
}
if (config.UpdateDisabled && !forceupdatecheck) if (config.UpdateDisabled && !forceupdatecheck)
{ {
logger.Info($"Skipping update check as it is disabled."); logger.Info($"Skipping update check as it is disabled.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment