diff options
| author | Bond-009 <bond.009@outlook.com> | 2025-03-01 14:53:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-01 14:53:19 +0100 |
| commit | 710c253318581d574049abe14eadafb88026dd53 (patch) | |
| tree | 94a73f05b8f62687d3793b8f9bdc7df9f70c4c42 | |
| parent | f035b1162528ed4c351ae03f2c217499e46bdd1a (diff) | |
| parent | d18066f0f23f819efdef145a74ffb173df636b58 (diff) | |
Merge pull request #13606 from nielsvanvelzen/goodbye-wal
Remove deprecated GetWakeOnLanInfo endpoint
| -rw-r--r-- | Jellyfin.Api/Controllers/SystemController.cs | 16 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/INetworkManager.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/System/WakeOnLanInfo.cs | 47 | ||||
| -rw-r--r-- | src/Jellyfin.Networking/Manager/NetworkManager.cs | 23 |
4 files changed, 0 insertions, 92 deletions
diff --git a/Jellyfin.Api/Controllers/SystemController.cs b/Jellyfin.Api/Controllers/SystemController.cs index 6c5ce4715..0ee11c070 100644 --- a/Jellyfin.Api/Controllers/SystemController.cs +++ b/Jellyfin.Api/Controllers/SystemController.cs @@ -212,20 +212,4 @@ public class SystemController : BaseJellyfinApiController FileStream stream = new FileStream(file.FullName, FileMode.Open, FileAccess.Read, fileShare, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous); return File(stream, "text/plain; charset=utf-8"); } - - /// <summary> - /// Gets wake on lan information. - /// </summary> - /// <response code="200">Information retrieved.</response> - /// <returns>An <see cref="IEnumerable{WakeOnLanInfo}"/> with the WakeOnLan infos.</returns> - [HttpGet("WakeOnLanInfo")] - [Authorize] - [Obsolete("This endpoint is obsolete.")] - [ProducesResponseType(StatusCodes.Status200OK)] - public ActionResult<IEnumerable<WakeOnLanInfo>> GetWakeOnLanInfo() - { - var result = _networkManager.GetMacAddresses() - .Select(i => new WakeOnLanInfo(i)); - return Ok(result); - } } diff --git a/MediaBrowser.Common/Net/INetworkManager.cs b/MediaBrowser.Common/Net/INetworkManager.cs index 78a391d36..d838144ff 100644 --- a/MediaBrowser.Common/Net/INetworkManager.cs +++ b/MediaBrowser.Common/Net/INetworkManager.cs @@ -95,12 +95,6 @@ namespace MediaBrowser.Common.Net string GetBindAddress(string source, out int? port); /// <summary> - /// Get a list of all the MAC addresses associated with active interfaces. - /// </summary> - /// <returns>List of MAC addresses.</returns> - IReadOnlyList<PhysicalAddress> GetMacAddresses(); - - /// <summary> /// Returns true if the address is part of the user defined LAN. /// </summary> /// <param name="address">IP to check.</param> diff --git a/MediaBrowser.Model/System/WakeOnLanInfo.cs b/MediaBrowser.Model/System/WakeOnLanInfo.cs deleted file mode 100644 index aba19a6ba..000000000 --- a/MediaBrowser.Model/System/WakeOnLanInfo.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Net.NetworkInformation; - -namespace MediaBrowser.Model.System -{ - /// <summary> - /// Provides the MAC address and port for wake-on-LAN functionality. - /// </summary> - public class WakeOnLanInfo - { - /// <summary> - /// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class. - /// </summary> - /// <param name="macAddress">The MAC address.</param> - public WakeOnLanInfo(PhysicalAddress macAddress) : this(macAddress.ToString()) - { - } - - /// <summary> - /// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class. - /// </summary> - /// <param name="macAddress">The MAC address.</param> - public WakeOnLanInfo(string macAddress) : this() - { - MacAddress = macAddress; - } - - /// <summary> - /// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class. - /// </summary> - public WakeOnLanInfo() - { - Port = 9; - } - - /// <summary> - /// Gets the MAC address of the device. - /// </summary> - /// <value>The MAC address.</value> - public string? MacAddress { get; } - - /// <summary> - /// Gets or sets the wake-on-LAN port. - /// </summary> - /// <value>The wake-on-LAN port.</value> - public int Port { get; set; } - } -} diff --git a/src/Jellyfin.Networking/Manager/NetworkManager.cs b/src/Jellyfin.Networking/Manager/NetworkManager.cs index dd01e9533..2fbcbf79c 100644 --- a/src/Jellyfin.Networking/Manager/NetworkManager.cs +++ b/src/Jellyfin.Networking/Manager/NetworkManager.cs @@ -50,11 +50,6 @@ public class NetworkManager : INetworkManager, IDisposable private bool _eventfire; /// <summary> - /// List of all interface MAC addresses. - /// </summary> - private IReadOnlyList<PhysicalAddress> _macAddresses; - - /// <summary> /// Dictionary containing interface addresses and their subnets. /// </summary> private List<IPData> _interfaces; @@ -91,7 +86,6 @@ public class NetworkManager : INetworkManager, IDisposable _startupConfig = startupConfig; _initLock = new(); _interfaces = new List<IPData>(); - _macAddresses = new List<PhysicalAddress>(); _publishedServerUrls = new List<PublishedServerUriOverride>(); _networkEventLock = new(); _remoteAddressFilter = new List<IPNetwork>(); @@ -215,7 +209,6 @@ public class NetworkManager : INetworkManager, IDisposable /// <summary> /// Generate a list of all the interface ip addresses and submasks where that are in the active/unknown state. - /// Generate a list of all active mac addresses that aren't loopback addresses. /// </summary> private void InitializeInterfaces() { @@ -224,7 +217,6 @@ public class NetworkManager : INetworkManager, IDisposable _logger.LogDebug("Refreshing interfaces."); var interfaces = new List<IPData>(); - var macAddresses = new List<PhysicalAddress>(); try { @@ -236,13 +228,6 @@ public class NetworkManager : INetworkManager, IDisposable try { var ipProperties = adapter.GetIPProperties(); - var mac = adapter.GetPhysicalAddress(); - - // Populate MAC list - if (adapter.NetworkInterfaceType != NetworkInterfaceType.Loopback && !PhysicalAddress.None.Equals(mac)) - { - macAddresses.Add(mac); - } // Populate interface list foreach (var info in ipProperties.UnicastAddresses) @@ -302,7 +287,6 @@ public class NetworkManager : INetworkManager, IDisposable _logger.LogDebug("Discovered {NumberOfInterfaces} interfaces.", interfaces.Count); _logger.LogDebug("Interfaces addresses: {Addresses}", interfaces.OrderByDescending(s => s.AddressFamily == AddressFamily.InterNetwork).Select(s => s.Address.ToString())); - _macAddresses = macAddresses; _interfaces = interfaces; } } @@ -712,13 +696,6 @@ public class NetworkManager : INetworkManager, IDisposable } /// <inheritdoc/> - public IReadOnlyList<PhysicalAddress> GetMacAddresses() - { - // Populated in construction - so always has values. - return _macAddresses; - } - - /// <inheritdoc/> public IReadOnlyList<IPData> GetLoopbacks() { if (!IsIPv4Enabled && !IsIPv6Enabled) |
