mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
cli: add option to disable network change detection (#11253)
This commit is contained in:
parent
3da081ba86
commit
987dbe98c8
@ -20,7 +20,8 @@ namespace Emby.Server.Implementations
|
|||||||
{ PlaylistsAllowDuplicatesKey, bool.FalseString },
|
{ PlaylistsAllowDuplicatesKey, bool.FalseString },
|
||||||
{ BindToUnixSocketKey, bool.FalseString },
|
{ BindToUnixSocketKey, bool.FalseString },
|
||||||
{ SqliteCacheSizeKey, "20000" },
|
{ SqliteCacheSizeKey, "20000" },
|
||||||
{ FfmpegSkipValidationKey, bool.FalseString }
|
{ FfmpegSkipValidationKey, bool.FalseString },
|
||||||
|
{ DetectNetworkChangeKey, bool.TrueString }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,12 @@ namespace Jellyfin.Server
|
|||||||
[Option("published-server-url", Required = false, HelpText = "Jellyfin Server URL to publish via auto discover process")]
|
[Option("published-server-url", Required = false, HelpText = "Jellyfin Server URL to publish via auto discover process")]
|
||||||
public string? PublishedServerUrl { get; set; }
|
public string? PublishedServerUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the server should not detect network status change.
|
||||||
|
/// </summary>
|
||||||
|
[Option("nonetchange", Required = false, HelpText = "Indicates that the server should not detect network status change.")]
|
||||||
|
public bool NoDetectNetworkChange { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the command line options as a dictionary that can be used in the .NET configuration system.
|
/// Gets the command line options as a dictionary that can be used in the .NET configuration system.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -90,6 +96,11 @@ namespace Jellyfin.Server
|
|||||||
config.Add(FfmpegPathKey, FFmpegPath);
|
config.Add(FfmpegPathKey, FFmpegPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NoDetectNetworkChange)
|
||||||
|
{
|
||||||
|
config.Add(DetectNetworkChangeKey, bool.FalseString);
|
||||||
|
}
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,11 @@ namespace MediaBrowser.Controller.Extensions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const string SqliteCacheSizeKey = "sqlite:cacheSize";
|
public const string SqliteCacheSizeKey = "sqlite:cacheSize";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The key for a setting that indicates whether the application should detect network status change.
|
||||||
|
/// </summary>
|
||||||
|
public const string DetectNetworkChangeKey = "DetectNetworkChange";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the application should host static web content from the <see cref="IConfiguration"/>.
|
/// Gets a value indicating whether the application should host static web content from the <see cref="IConfiguration"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -97,10 +97,15 @@ public class NetworkManager : INetworkManager, IDisposable
|
|||||||
_networkEventLock = new object();
|
_networkEventLock = new object();
|
||||||
_remoteAddressFilter = new List<IPNetwork>();
|
_remoteAddressFilter = new List<IPNetwork>();
|
||||||
|
|
||||||
|
_ = bool.TryParse(startupConfig[DetectNetworkChangeKey], out var detectNetworkChange);
|
||||||
|
|
||||||
UpdateSettings(_configurationManager.GetNetworkConfiguration());
|
UpdateSettings(_configurationManager.GetNetworkConfiguration());
|
||||||
|
|
||||||
NetworkChange.NetworkAddressChanged += OnNetworkAddressChanged;
|
if (detectNetworkChange)
|
||||||
NetworkChange.NetworkAvailabilityChanged += OnNetworkAvailabilityChanged;
|
{
|
||||||
|
NetworkChange.NetworkAddressChanged += OnNetworkAddressChanged;
|
||||||
|
NetworkChange.NetworkAvailabilityChanged += OnNetworkAvailabilityChanged;
|
||||||
|
}
|
||||||
|
|
||||||
_configurationManager.NamedConfigurationUpdated += ConfigurationUpdated;
|
_configurationManager.NamedConfigurationUpdated += ConfigurationUpdated;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user