mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #13606 from nielsvanvelzen/goodbye-wal
Remove deprecated GetWakeOnLanInfo endpoint
This commit is contained in:
commit
710c253318
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -94,12 +94,6 @@ namespace MediaBrowser.Common.Net
|
||||
/// <returns>IP address to use, or loopback address if all else fails.</returns>
|
||||
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>
|
||||
|
@ -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; }
|
||||
}
|
||||
}
|
@ -49,11 +49,6 @@ public class NetworkManager : INetworkManager, IDisposable
|
||||
/// </summary>
|
||||
private bool _eventfire;
|
||||
|
||||
/// <summary>
|
||||
/// List of all interface MAC addresses.
|
||||
/// </summary>
|
||||
private IReadOnlyList<PhysicalAddress> _macAddresses;
|
||||
|
||||
/// <summary>
|
||||
/// Dictionary containing interface addresses and their subnets.
|
||||
/// </summary>
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -711,13 +695,6 @@ public class NetworkManager : INetworkManager, IDisposable
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyList<PhysicalAddress> GetMacAddresses()
|
||||
{
|
||||
// Populated in construction - so always has values.
|
||||
return _macAddresses;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyList<IPData> GetLoopbacks()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user