aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/SystemController.cs
diff options
context:
space:
mode:
authorBrian J. Murrell <brian@interlinx.bc.ca>2021-11-29 17:53:26 -0500
committerBrian J. Murrell <brian@interlinx.bc.ca>2021-11-29 17:53:26 -0500
commit757970bfc17b0eb1566b45fbe700dcb16423b190 (patch)
tree63fbc171621f5ec7ae156f341d9b1df37643deac /Jellyfin.Api/Controllers/SystemController.cs
parenta3a4689af22693b535e80b98624831866fda2a61 (diff)
parentc677b4f6b7f7e874097aa2cee866d9ed1e574178 (diff)
Merge remote-tracking branch 'origin/master' into HEAD
Diffstat (limited to 'Jellyfin.Api/Controllers/SystemController.cs')
-rw-r--r--Jellyfin.Api/Controllers/SystemController.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/Jellyfin.Api/Controllers/SystemController.cs b/Jellyfin.Api/Controllers/SystemController.cs
index bbbe5fb8d..2ff85fd2a 100644
--- a/Jellyfin.Api/Controllers/SystemController.cs
+++ b/Jellyfin.Api/Controllers/SystemController.cs
@@ -66,7 +66,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<SystemInfo> GetSystemInfo()
{
- return _appHost.GetSystemInfo(Request.HttpContext.Connection.RemoteIpAddress ?? IPAddress.Loopback);
+ return _appHost.GetSystemInfo(Request);
}
/// <summary>
@@ -78,7 +78,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<PublicSystemInfo> GetPublicSystemInfo()
{
- return _appHost.GetPublicSystemInfo(Request.HttpContext.Connection.RemoteIpAddress ?? IPAddress.Loopback);
+ return _appHost.GetPublicSystemInfo(Request);
}
/// <summary>
@@ -201,7 +201,7 @@ namespace Jellyfin.Api.Controllers
// For older files, assume fully static
var fileShare = file.LastWriteTimeUtc < DateTime.UtcNow.AddHours(-1) ? FileShare.Read : FileShare.ReadWrite;
- FileStream stream = new FileStream(file.FullName, FileMode.Open, FileAccess.Read, fileShare);
+ FileStream stream = new FileStream(file.FullName, FileMode.Open, FileAccess.Read, fileShare, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
return File(stream, "text/plain; charset=utf-8");
}
@@ -212,10 +212,13 @@ namespace Jellyfin.Api.Controllers
/// <returns>An <see cref="IEnumerable{WakeOnLanInfo}"/> with the WakeOnLan infos.</returns>
[HttpGet("WakeOnLanInfo")]
[Authorize(Policy = Policies.DefaultAuthorization)]
+ [Obsolete("This endpoint is obsolete.")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<IEnumerable<WakeOnLanInfo>> GetWakeOnLanInfo()
{
- var result = _appHost.GetWakeOnLanInfo();
+ var result = _network.GetMacAddresses()
+ .Select(i => new WakeOnLanInfo(i))
+ .ToList();
return Ok(result);
}
}