Add Api and startup check for sufficient storage capacity (#13888)

This commit is contained in:
JPVenson
2025-04-21 05:06:50 +03:00
committed by GitHub
parent 5e4bd744c0
commit a0931baa8e
12 changed files with 560 additions and 125 deletions
@@ -6,6 +6,7 @@ using System.Linq;
using System.Net.Mime;
using Jellyfin.Api.Attributes;
using Jellyfin.Api.Constants;
using Jellyfin.Api.Models.SystemInfoDtos;
using MediaBrowser.Common.Api;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
@@ -71,6 +72,19 @@ public class SystemController : BaseJellyfinApiController
public ActionResult<SystemInfo> GetSystemInfo()
=> _systemManager.GetSystemInfo(Request);
/// <summary>
/// Gets information about the server.
/// </summary>
/// <response code="200">Information retrieved.</response>
/// <response code="403">User does not have permission to retrieve information.</response>
/// <returns>A <see cref="SystemInfo"/> with info about the system.</returns>
[HttpGet("Info/Storage")]
[Authorize(Policy = Policies.RequiresElevation)]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
public ActionResult<SystemStorageDto> GetSystemStorage()
=> Ok(SystemStorageDto.FromSystemStorageInfo(_systemManager.GetSystemStorageInfo()));
/// <summary>
/// Gets public information about the server.
/// </summary>