aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Api/Controllers')
-rw-r--r--Jellyfin.Api/Controllers/AudioController.cs8
-rw-r--r--Jellyfin.Api/Controllers/BrandingController.cs2
-rw-r--r--Jellyfin.Api/Controllers/DlnaServerController.cs12
-rw-r--r--Jellyfin.Api/Controllers/DynamicHlsController.cs4
-rw-r--r--Jellyfin.Api/Controllers/HlsSegmentController.cs4
-rw-r--r--Jellyfin.Api/Controllers/ImageController.cs28
-rw-r--r--Jellyfin.Api/Controllers/ItemsController.cs4
-rw-r--r--Jellyfin.Api/Controllers/LibraryController.cs14
-rw-r--r--Jellyfin.Api/Controllers/LibraryStructureController.cs4
-rw-r--r--Jellyfin.Api/Controllers/LiveTvController.cs7
-rw-r--r--Jellyfin.Api/Controllers/MediaInfoController.cs15
-rw-r--r--Jellyfin.Api/Controllers/SessionController.cs2
-rw-r--r--Jellyfin.Api/Controllers/StartupController.cs4
-rw-r--r--Jellyfin.Api/Controllers/SubtitleController.cs2
-rw-r--r--Jellyfin.Api/Controllers/SyncPlayController.cs18
-rw-r--r--Jellyfin.Api/Controllers/SystemController.cs4
-rw-r--r--Jellyfin.Api/Controllers/TrailersController.cs36
-rw-r--r--Jellyfin.Api/Controllers/UniversalAudioController.cs124
-rw-r--r--Jellyfin.Api/Controllers/VideoHlsController.cs2
-rw-r--r--Jellyfin.Api/Controllers/VideosController.cs6
20 files changed, 94 insertions, 206 deletions
diff --git a/Jellyfin.Api/Controllers/AudioController.cs b/Jellyfin.Api/Controllers/AudioController.cs
index ebae1caa0..4de87616c 100644
--- a/Jellyfin.Api/Controllers/AudioController.cs
+++ b/Jellyfin.Api/Controllers/AudioController.cs
@@ -144,10 +144,10 @@ namespace Jellyfin.Api.Controllers
/// <param name="streamOptions">Optional. The streaming options.</param>
/// <response code="200">Audio stream returned.</response>
/// <returns>A <see cref="FileResult"/> containing the audio file.</returns>
- [HttpGet("{itemId}/{stream=stream}.{container?}")]
- [HttpGet("{itemId}/stream")]
- [HttpHead("{itemId}/{stream=stream}.{container?}")]
- [HttpHead("{itemId}/stream")]
+ [HttpGet("{itemId}/{stream=stream}.{container?}", Name = "GetAudioStreamByContainer")]
+ [HttpGet("{itemId}/stream", Name = "GetAudioStream")]
+ [HttpHead("{itemId}/{stream=stream}.{container?}", Name = "HeadAudioStreamByContainer")]
+ [HttpHead("{itemId}/stream", Name = "HeadAudioStream")]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<ActionResult> GetAudioStream(
[FromRoute] Guid itemId,
diff --git a/Jellyfin.Api/Controllers/BrandingController.cs b/Jellyfin.Api/Controllers/BrandingController.cs
index 67790c0e4..1d4836f27 100644
--- a/Jellyfin.Api/Controllers/BrandingController.cs
+++ b/Jellyfin.Api/Controllers/BrandingController.cs
@@ -44,7 +44,7 @@ namespace Jellyfin.Api.Controllers
/// or a <see cref="NoContentResult"/> if the css is not configured.
/// </returns>
[HttpGet("Css")]
- [HttpGet("Css.css")]
+ [HttpGet("Css.css", Name = "GetBrandingCss_2")]
[Produces("text/css")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
diff --git a/Jellyfin.Api/Controllers/DlnaServerController.cs b/Jellyfin.Api/Controllers/DlnaServerController.cs
index 2f5561adb..ef507f2ed 100644
--- a/Jellyfin.Api/Controllers/DlnaServerController.cs
+++ b/Jellyfin.Api/Controllers/DlnaServerController.cs
@@ -42,8 +42,8 @@ namespace Jellyfin.Api.Controllers
/// <param name="serverId">Server UUID.</param>
/// <response code="200">Description xml returned.</response>
/// <returns>An <see cref="OkResult"/> containing the description xml.</returns>
- [HttpGet("{serverId}/description.xml")]
[HttpGet("{serverId}/description")]
+ [HttpGet("{serverId}/description.xml", Name = "GetDescriptionXml_2")]
[Produces(XMLContentType)]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult GetDescriptionXml([FromRoute] string serverId)
@@ -60,8 +60,8 @@ namespace Jellyfin.Api.Controllers
/// <param name="serverId">Server UUID.</param>
/// <response code="200">Dlna content directory returned.</response>
/// <returns>An <see cref="OkResult"/> containing the dlna content directory xml.</returns>
- [HttpGet("{serverId}/ContentDirectory/ContentDirectory.xml")]
[HttpGet("{serverId}/ContentDirectory/ContentDirectory")]
+ [HttpGet("{serverId}/ContentDirectory/ContentDirectory.xml", Name = "GetContentDirectory_2")]
[Produces(XMLContentType)]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
@@ -75,8 +75,8 @@ namespace Jellyfin.Api.Controllers
/// </summary>
/// <param name="serverId">Server UUID.</param>
/// <returns>Dlna media receiver registrar xml.</returns>
- [HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml")]
[HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar")]
+ [HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml", Name = "GetMediaReceiverRegistrar_2")]
[Produces(XMLContentType)]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
@@ -90,8 +90,8 @@ namespace Jellyfin.Api.Controllers
/// </summary>
/// <param name="serverId">Server UUID.</param>
/// <returns>Dlna media receiver registrar xml.</returns>
- [HttpGet("{serverId}/ConnectionManager/ConnectionManager.xml")]
[HttpGet("{serverId}/ConnectionManager/ConnectionManager")]
+ [HttpGet("{serverId}/ConnectionManager/ConnectionManager.xml", Name = "GetConnectionManager_2")]
[Produces(XMLContentType)]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
@@ -181,7 +181,7 @@ namespace Jellyfin.Api.Controllers
/// <param name="serverId">Server UUID.</param>
/// <param name="fileName">The icon filename.</param>
/// <returns>Icon stream.</returns>
- [HttpGet("{serverId}/icons/{filename}")]
+ [HttpGet("{serverId}/icons/{fileName}")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
public ActionResult GetIconId([FromRoute] string serverId, [FromRoute] string fileName)
{
@@ -193,7 +193,7 @@ namespace Jellyfin.Api.Controllers
/// </summary>
/// <param name="fileName">The icon filename.</param>
/// <returns>Icon stream.</returns>
- [HttpGet("icons/{filename}")]
+ [HttpGet("icons/{fileName}")]
public ActionResult GetIcon([FromRoute] string fileName)
{
return GetIconInternal(fileName);
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index b7e1837c9..c4f79ce95 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -165,7 +165,7 @@ namespace Jellyfin.Api.Controllers
/// <response code="200">Video stream returned.</response>
/// <returns>A <see cref="FileResult"/> containing the playlist file.</returns>
[HttpGet("/Videos/{itemId}/master.m3u8")]
- [HttpHead("/Videos/{itemId}/master.m3u8")]
+ [HttpHead("/Videos/{itemId}/master.m3u8", Name = "HeadMasterHlsVideoPlaylist")]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<ActionResult> GetMasterHlsVideoPlaylist(
[FromRoute] Guid itemId,
@@ -335,7 +335,7 @@ namespace Jellyfin.Api.Controllers
/// <response code="200">Audio stream returned.</response>
/// <returns>A <see cref="FileResult"/> containing the playlist file.</returns>
[HttpGet("/Audio/{itemId}/master.m3u8")]
- [HttpHead("/Audio/{itemId}/master.m3u8")]
+ [HttpHead("/Audio/{itemId}/master.m3u8", Name = "HeadMasterHlsAudioPlaylist")]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<ActionResult> GetMasterHlsAudioPlaylist(
[FromRoute] Guid itemId,
diff --git a/Jellyfin.Api/Controllers/HlsSegmentController.cs b/Jellyfin.Api/Controllers/HlsSegmentController.cs
index efdb6a369..7bf9326a7 100644
--- a/Jellyfin.Api/Controllers/HlsSegmentController.cs
+++ b/Jellyfin.Api/Controllers/HlsSegmentController.cs
@@ -50,8 +50,8 @@ namespace Jellyfin.Api.Controllers
/// <returns>A <see cref="FileStreamResult"/> containing the audio stream.</returns>
// Can't require authentication just yet due to seeing some requests come from Chrome without full query string
// [Authenticated]
- [HttpGet("/Audio/{itemId}/hls/{segmentId}/stream.mp3")]
- [HttpGet("/Audio/{itemId}/hls/{segmentId}/stream.aac")]
+ [HttpGet("/Audio/{itemId}/hls/{segmentId}/stream.mp3", Name = "GetHlsAudioSegmentLegacyMp3")]
+ [HttpGet("/Audio/{itemId}/hls/{segmentId}/stream.aac", Name = "GetHlsAudioSegmentLegacyAac")]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "itemId", Justification = "Required for ServiceStack")]
public ActionResult GetHlsAudioSegmentLegacy([FromRoute] string itemId, [FromRoute] string segmentId)
diff --git a/Jellyfin.Api/Controllers/ImageController.cs b/Jellyfin.Api/Controllers/ImageController.cs
index 18220c5f3..3a445b1b3 100644
--- a/Jellyfin.Api/Controllers/ImageController.cs
+++ b/Jellyfin.Api/Controllers/ImageController.cs
@@ -82,7 +82,7 @@ namespace Jellyfin.Api.Controllers
/// <response code="403">User does not have permission to delete the image.</response>
/// <returns>A <see cref="NoContentResult"/>.</returns>
[HttpPost("/Users/{userId}/Images/{imageType}")]
- [HttpPost("/Users/{userId}/Images/{imageType}/{index?}")]
+ [HttpPost("/Users/{userId}/Images/{imageType}/{index?}", Name = "PostUserImage_2")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "imageType", Justification = "Imported from ServiceStack")]
@@ -128,7 +128,7 @@ namespace Jellyfin.Api.Controllers
/// <response code="403">User does not have permission to delete the image.</response>
/// <returns>A <see cref="NoContentResult"/>.</returns>
[HttpDelete("/Users/{userId}/Images/{itemType}")]
- [HttpDelete("/Users/{userId}/Images/{itemType}/{index?}")]
+ [HttpDelete("/Users/{userId}/Images/{itemType}/{index?}", Name = "DeleteUserImage_2")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "imageType", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "index", Justification = "Imported from ServiceStack")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
@@ -167,7 +167,7 @@ namespace Jellyfin.Api.Controllers
/// <response code="404">Item not found.</response>
/// <returns>A <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if item not found.</returns>
[HttpDelete("/Items/{itemId}/Images/{imageType}")]
- [HttpDelete("/Items/{itemId}/Images/{imageType}/{imageIndex?}")]
+ [HttpDelete("/Items/{itemId}/Images/{imageType}/{imageIndex?}", Name = "DeleteItemImage_2")]
[Authorize(Policy = Policies.RequiresElevation)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
@@ -196,7 +196,7 @@ namespace Jellyfin.Api.Controllers
/// <response code="404">Item not found.</response>
/// <returns>A <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if item not found.</returns>
[HttpPost("/Items/{itemId}/Images/{imageType}")]
- [HttpPost("/Items/{itemId}/Images/{imageType}/{imageIndex?}")]
+ [HttpPost("/Items/{itemId}/Images/{imageType}/{imageIndex?}", Name = "SetItemImage_2")]
[Authorize(Policy = Policies.RequiresElevation)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
@@ -342,9 +342,9 @@ namespace Jellyfin.Api.Controllers
/// or a <see cref="NotFoundResult"/> if item not found.
/// </returns>
[HttpGet("/Items/{itemId}/Images/{imageType}")]
- [HttpHead("/Items/{itemId}/Images/{imageType}")]
- [HttpGet("/Items/{itemId}/Images/{imageType}/{imageIndex?}")]
- [HttpHead("/Items/{itemId}/Images/{imageType}/{imageIndex?}")]
+ [HttpHead("/Items/{itemId}/Images/{imageType}", Name = "HeadItemImage")]
+ [HttpGet("/Items/{itemId}/Images/{imageType}/{imageIndex?}", Name = "GetItemImage_2")]
+ [HttpHead("/Items/{itemId}/Images/{imageType}/{imageIndex?}", Name = "HeadItemImage_2")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> GetItemImage(
@@ -422,7 +422,7 @@ namespace Jellyfin.Api.Controllers
/// or a <see cref="NotFoundResult"/> if item not found.
/// </returns>
[HttpGet("/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}")]
- [HttpHead("/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}")]
+ [HttpHead("/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}", Name = "HeadItemImage2")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> GetItemImage2(
@@ -500,7 +500,7 @@ namespace Jellyfin.Api.Controllers
/// or a <see cref="NotFoundResult"/> if item not found.
/// </returns>
[HttpGet("/Artists/{name}/Images/{imageType}/{imageIndex?}")]
- [HttpHead("/Artists/{name}/Images/{imageType}/{imageIndex?}")]
+ [HttpHead("/Artists/{name}/Images/{imageType}/{imageIndex?}", Name = "HeadArtistImage")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> GetArtistImage(
@@ -578,7 +578,7 @@ namespace Jellyfin.Api.Controllers
/// or a <see cref="NotFoundResult"/> if item not found.
/// </returns>
[HttpGet("/Genres/{name}/Images/{imageType}/{imageIndex?}")]
- [HttpHead("/Genres/{name}/Images/{imageType}/{imageIndex?}")]
+ [HttpHead("/Genres/{name}/Images/{imageType}/{imageIndex?}", Name = "HeadGenreImage")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> GetGenreImage(
@@ -656,7 +656,7 @@ namespace Jellyfin.Api.Controllers
/// or a <see cref="NotFoundResult"/> if item not found.
/// </returns>
[HttpGet("/MusicGenres/{name}/Images/{imageType}/{imageIndex?}")]
- [HttpHead("/MusicGenres/{name}/Images/{imageType}/{imageIndex?}")]
+ [HttpHead("/MusicGenres/{name}/Images/{imageType}/{imageIndex?}", Name = "HeadMusicGenreImage")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> GetMusicGenreImage(
@@ -734,7 +734,7 @@ namespace Jellyfin.Api.Controllers
/// or a <see cref="NotFoundResult"/> if item not found.
/// </returns>
[HttpGet("/Persons/{name}/Images/{imageType}/{imageIndex?}")]
- [HttpHead("/Persons/{name}/Images/{imageType}/{imageIndex?}")]
+ [HttpHead("/Persons/{name}/Images/{imageType}/{imageIndex?}", Name = "HeadPersonImage")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> GetPersonImage(
@@ -812,7 +812,7 @@ namespace Jellyfin.Api.Controllers
/// or a <see cref="NotFoundResult"/> if item not found.
/// </returns>
[HttpGet("/Studios/{name}/Images/{imageType}/{imageIndex?}")]
- [HttpHead("/Studios/{name}/Images/{imageType}/{imageIndex?}")]
+ [HttpHead("/Studios/{name}/Images/{imageType}/{imageIndex?}", Name = "HeadStudioImage")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> GetStudioImage(
@@ -890,7 +890,7 @@ namespace Jellyfin.Api.Controllers
/// or a <see cref="NotFoundResult"/> if item not found.
/// </returns>
[HttpGet("/Users/{userId}/Images/{imageType}/{imageIndex?}")]
- [HttpHead("/Users/{userId}/Images/{imageType}/{imageIndex?}")]
+ [HttpHead("/Users/{userId}/Images/{imageType}/{imageIndex?}", Name = "HeadUserImage")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> GetUserImage(
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs
index 41fe47db1..354741ced 100644
--- a/Jellyfin.Api/Controllers/ItemsController.cs
+++ b/Jellyfin.Api/Controllers/ItemsController.cs
@@ -30,7 +30,7 @@ namespace Jellyfin.Api.Controllers
private readonly ILibraryManager _libraryManager;
private readonly ILocalizationManager _localization;
private readonly IDtoService _dtoService;
- private readonly ILogger _logger;
+ private readonly ILogger<ItemsController> _logger;
/// <summary>
/// Initializes a new instance of the <see cref="ItemsController"/> class.
@@ -140,7 +140,7 @@ namespace Jellyfin.Api.Controllers
/// <param name="enableImages">Optional, include image information in output.</param>
/// <returns>A <see cref="QueryResult{BaseItemDto}"/> with the items.</returns>
[HttpGet("/Items")]
- [HttpGet("/Users/{uId}/Items")]
+ [HttpGet("/Users/{uId}/Items", Name = "GetItems_2")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<QueryResult<BaseItemDto>> GetItems(
[FromRoute] Guid? uId,
diff --git a/Jellyfin.Api/Controllers/LibraryController.cs b/Jellyfin.Api/Controllers/LibraryController.cs
index 5ad466c55..0ec7e2b8c 100644
--- a/Jellyfin.Api/Controllers/LibraryController.cs
+++ b/Jellyfin.Api/Controllers/LibraryController.cs
@@ -521,7 +521,7 @@ namespace Jellyfin.Api.Controllers
/// <param name="tvdbId">The tvdbId.</param>
/// <response code="204">Report success.</response>
/// <returns>A <see cref="NoContentResult"/>.</returns>
- [HttpPost("/Library/Series/Added")]
+ [HttpPost("/Library/Series/Added", Name = "PostAddedSeries")]
[HttpPost("/Library/Series/Updated")]
[Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
@@ -551,7 +551,7 @@ namespace Jellyfin.Api.Controllers
/// <param name="imdbId">The imdbId.</param>
/// <response code="204">Report success.</response>
/// <returns>A <see cref="NoContentResult"/>.</returns>
- [HttpPost("/Library/Movies/Added")]
+ [HttpPost("/Library/Movies/Added", Name = "PostAddedMovies")]
[HttpPost("/Library/Movies/Updated")]
[Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
@@ -679,12 +679,12 @@ namespace Jellyfin.Api.Controllers
/// <param name="fields">Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.</param>
/// <response code="200">Similar items returned.</response>
/// <returns>A <see cref="QueryResult{BaseItemDto}"/> containing the similar items.</returns>
- [HttpGet("/Artists/{itemId}/Similar")]
+ [HttpGet("/Artists/{itemId}/Similar", Name = "GetSimilarArtists2")]
[HttpGet("/Items/{itemId}/Similar")]
- [HttpGet("/Albums/{itemId}/Similar")]
- [HttpGet("/Shows/{itemId}/Similar")]
- [HttpGet("/Movies/{itemId}/Similar")]
- [HttpGet("/Trailers/{itemId}/Similar")]
+ [HttpGet("/Albums/{itemId}/Similar", Name = "GetSimilarAlbums2")]
+ [HttpGet("/Shows/{itemId}/Similar", Name = "GetSimilarShows2")]
+ [HttpGet("/Movies/{itemId}/Similar", Name = "GetSimilarMovies2")]
+ [HttpGet("/Trailers/{itemId}/Similar", Name = "GetSimilarTrailers2")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<QueryResult<BaseItemDto>> GetSimilarItems(
[FromRoute] Guid itemId,
diff --git a/Jellyfin.Api/Controllers/LibraryStructureController.cs b/Jellyfin.Api/Controllers/LibraryStructureController.cs
index b7f3c9b07..827879e0a 100644
--- a/Jellyfin.Api/Controllers/LibraryStructureController.cs
+++ b/Jellyfin.Api/Controllers/LibraryStructureController.cs
@@ -249,7 +249,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status204NoContent)]
public ActionResult UpdateMediaPath(
[FromQuery] string? name,
- [FromQuery] MediaPathInfo? pathInfo)
+ [FromBody] MediaPathInfo? pathInfo)
{
if (string.IsNullOrWhiteSpace(name))
{
@@ -320,7 +320,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status204NoContent)]
public ActionResult UpdateLibraryOptions(
[FromQuery] string? id,
- [FromQuery] LibraryOptions? libraryOptions)
+ [FromBody] LibraryOptions? libraryOptions)
{
var collectionFolder = (CollectionFolder)_libraryManager.GetItemById(id);
diff --git a/Jellyfin.Api/Controllers/LiveTvController.cs b/Jellyfin.Api/Controllers/LiveTvController.cs
index 9144d6f28..89112eea7 100644
--- a/Jellyfin.Api/Controllers/LiveTvController.cs
+++ b/Jellyfin.Api/Controllers/LiveTvController.cs
@@ -23,7 +23,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Querying;
@@ -128,7 +127,7 @@ namespace Jellyfin.Api.Controllers
[HttpGet("Channels")]
[ProducesResponseType(StatusCodes.Status200OK)]
[Authorize(Policy = Policies.DefaultAuthorization)]
- public ActionResult<QueryResult<BaseItemDto>> GetChannels(
+ public ActionResult<QueryResult<BaseItemDto>> GetLiveTvChannels(
[FromQuery] ChannelType? type,
[FromQuery] Guid? userId,
[FromQuery] int? startIndex,
@@ -536,7 +535,7 @@ namespace Jellyfin.Api.Controllers
[HttpGet("Programs")]
[ProducesResponseType(StatusCodes.Status200OK)]
[Authorize(Policy = Policies.DefaultAuthorization)]
- public async Task<ActionResult<QueryResult<BaseItemDto>>> GetPrograms(
+ public async Task<ActionResult<QueryResult<BaseItemDto>>> GetLiveTvPrograms(
[FromQuery] string? channelIds,
[FromQuery] Guid? userId,
[FromQuery] DateTime? minStartDate,
@@ -934,7 +933,7 @@ namespace Jellyfin.Api.Controllers
[Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("This endpoint is obsolete.")]
- public ActionResult<BaseItemDto> GetRecordingGroup([FromQuery] Guid? groupId)
+ public ActionResult<BaseItemDto> GetRecordingGroup([FromRoute] Guid? groupId)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/MediaInfoController.cs b/Jellyfin.Api/Controllers/MediaInfoController.cs
index c2c02c02c..5b0f46b02 100644
--- a/Jellyfin.Api/Controllers/MediaInfoController.cs
+++ b/Jellyfin.Api/Controllers/MediaInfoController.cs
@@ -7,6 +7,7 @@ using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Api.Constants;
+using Jellyfin.Api.Models.MediaInfoDtos;
using Jellyfin.Api.Models.VideoDtos;
using Jellyfin.Data.Entities;
using Jellyfin.Data.Enums;
@@ -43,7 +44,7 @@ namespace Jellyfin.Api.Controllers
private readonly IMediaEncoder _mediaEncoder;
private readonly IUserManager _userManager;
private readonly IAuthorizationContext _authContext;
- private readonly ILogger _logger;
+ private readonly ILogger<MediaInfoController> _logger;
private readonly IServerConfigurationManager _serverConfigurationManager;
/// <summary>
@@ -91,7 +92,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<ActionResult<PlaybackInfoResponse>> GetPlaybackInfo([FromRoute] Guid itemId, [FromQuery] Guid? userId)
{
- return await GetPlaybackInfoInternal(itemId, userId, null, null).ConfigureAwait(false);
+ return await GetPlaybackInfoInternal(itemId, userId).ConfigureAwait(false);
}
/// <summary>
@@ -231,8 +232,7 @@ namespace Jellyfin.Api.Controllers
/// <param name="subtitleStreamIndex">The subtitle stream index.</param>
/// <param name="maxAudioChannels">The maximum number of audio channels.</param>
/// <param name="itemId">The item id.</param>
- /// <param name="deviceProfile">The device profile.</param>
- /// <param name="directPlayProtocols">The direct play protocols. Default: <see cref="MediaProtocol.Http"/>.</param>
+ /// <param name="openLiveStreamDto">The open live stream dto.</param>
/// <param name="enableDirectPlay">Whether to enable direct play. Default: true.</param>
/// <param name="enableDirectStream">Whether to enable direct stream. Default: true.</param>
/// <response code="200">Media source opened.</response>
@@ -249,8 +249,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? subtitleStreamIndex,
[FromQuery] int? maxAudioChannels,
[FromQuery] Guid? itemId,
- [FromQuery] DeviceProfile? deviceProfile,
- [FromQuery] MediaProtocol[] directPlayProtocols,
+ [FromBody] OpenLiveStreamDto openLiveStreamDto,
[FromQuery] bool enableDirectPlay = true,
[FromQuery] bool enableDirectStream = true)
{
@@ -265,10 +264,10 @@ namespace Jellyfin.Api.Controllers
SubtitleStreamIndex = subtitleStreamIndex,
MaxAudioChannels = maxAudioChannels,
ItemId = itemId ?? Guid.Empty,
- DeviceProfile = deviceProfile,
+ DeviceProfile = openLiveStreamDto?.DeviceProfile,
EnableDirectPlay = enableDirectPlay,
EnableDirectStream = enableDirectStream,
- DirectPlayProtocols = directPlayProtocols ?? new[] { MediaProtocol.Http }
+ DirectPlayProtocols = openLiveStreamDto?.DirectPlayProtocols ?? new[] { MediaProtocol.Http }
};
return await OpenMediaSource(request).ConfigureAwait(false);
}
diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs
index 0c98a8e71..1b300e0d8 100644
--- a/Jellyfin.Api/Controllers/SessionController.cs
+++ b/Jellyfin.Api/Controllers/SessionController.cs
@@ -241,7 +241,7 @@ namespace Jellyfin.Api.Controllers
/// <param name="command">The command to send.</param>
/// <response code="204">General command sent to session.</response>
/// <returns>A <see cref="NoContentResult"/>.</returns>
- [HttpPost("/Sessions/{sessionId}/Command/{Command}")]
+ [HttpPost("/Sessions/{sessionId}/Command/{command}")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public ActionResult SendGeneralCommand(
[FromRoute] string? sessionId,
diff --git a/Jellyfin.Api/Controllers/StartupController.cs b/Jellyfin.Api/Controllers/StartupController.cs
index f9e4e61b5..c8e3cc4f5 100644
--- a/Jellyfin.Api/Controllers/StartupController.cs
+++ b/Jellyfin.Api/Controllers/StartupController.cs
@@ -106,7 +106,7 @@ namespace Jellyfin.Api.Controllers
/// <response code="200">Initial user retrieved.</response>
/// <returns>The first user.</returns>
[HttpGet("User")]
- [HttpGet("FirstUser")]
+ [HttpGet("FirstUser", Name = "GetFirstUser_2")]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<StartupUserDto> GetFirstUser()
{
@@ -131,7 +131,7 @@ namespace Jellyfin.Api.Controllers
/// </returns>
[HttpPost("User")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
- public async Task<ActionResult> UpdateUser([FromForm] StartupUserDto startupUserDto)
+ public async Task<ActionResult> UpdateStartupUser([FromForm] StartupUserDto startupUserDto)
{
var user = _userManager.Users.First();
diff --git a/Jellyfin.Api/Controllers/SubtitleController.cs b/Jellyfin.Api/Controllers/SubtitleController.cs
index b62ff80fc..f8c19d15c 100644
--- a/Jellyfin.Api/Controllers/SubtitleController.cs
+++ b/Jellyfin.Api/Controllers/SubtitleController.cs
@@ -182,7 +182,7 @@ namespace Jellyfin.Api.Controllers
/// <response code="200">File returned.</response>
/// <returns>A <see cref="FileContentResult"/> with the subtitle file.</returns>
[HttpGet("/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/Stream.{format}")]
- [HttpGet("/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/{startPositionTicks?}/Stream.{format}")]
+ [HttpGet("/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/{startPositionTicks?}/Stream.{format}", Name = "GetSubtitle_2")]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<ActionResult> GetSubtitle(
[FromRoute, Required] Guid itemId,
diff --git a/Jellyfin.Api/Controllers/SyncPlayController.cs b/Jellyfin.Api/Controllers/SyncPlayController.cs
index 55ed42227..2b1b95b1b 100644
--- a/Jellyfin.Api/Controllers/SyncPlayController.cs
+++ b/Jellyfin.Api/Controllers/SyncPlayController.cs
@@ -47,7 +47,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
[HttpPost("New")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
- public ActionResult CreateNewGroup()
+ public ActionResult SyncPlayCreateGroup()
{
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
_syncPlayManager.NewGroup(currentSession, CancellationToken.None);
@@ -62,7 +62,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
[HttpPost("Join")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
- public ActionResult JoinGroup([FromQuery, Required] Guid groupId)
+ public ActionResult SyncPlayJoinGroup([FromQuery, Required] Guid groupId)
{
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
@@ -82,7 +82,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
[HttpPost("Leave")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
- public ActionResult LeaveGroup()
+ public ActionResult SyncPlayLeaveGroup()
{
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
_syncPlayManager.LeaveGroup(currentSession, CancellationToken.None);
@@ -97,7 +97,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>An <see cref="IEnumerable{GrouüInfoView}"/> containing the available SyncPlay groups.</returns>
[HttpGet("List")]
[ProducesResponseType(StatusCodes.Status200OK)]
- public ActionResult<IEnumerable<GroupInfoView>> GetSyncPlayGroups([FromQuery] Guid? filterItemId)
+ public ActionResult<IEnumerable<GroupInfoView>> SyncPlayGetGroups([FromQuery] Guid? filterItemId)
{
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
return Ok(_syncPlayManager.ListGroups(currentSession, filterItemId.HasValue ? filterItemId.Value : Guid.Empty));
@@ -110,7 +110,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
[HttpPost("Play")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
- public ActionResult Play()
+ public ActionResult SyncPlayPlay()
{
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
var syncPlayRequest = new PlaybackRequest()
@@ -128,7 +128,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
[HttpPost("Pause")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
- public ActionResult Pause()
+ public ActionResult SyncPlayPause()
{
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
var syncPlayRequest = new PlaybackRequest()
@@ -147,7 +147,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
[HttpPost("Seek")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
- public ActionResult Seek([FromQuery] long positionTicks)
+ public ActionResult SyncPlaySeek([FromQuery] long positionTicks)
{
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
var syncPlayRequest = new PlaybackRequest()
@@ -169,7 +169,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
[HttpPost("Buffering")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
- public ActionResult Buffering([FromQuery] DateTime when, [FromQuery] long positionTicks, [FromQuery] bool bufferingDone)
+ public ActionResult SyncPlayBuffering([FromQuery] DateTime when, [FromQuery] long positionTicks, [FromQuery] bool bufferingDone)
{
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
var syncPlayRequest = new PlaybackRequest()
@@ -190,7 +190,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
[HttpPost("Ping")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
- public ActionResult Ping([FromQuery] double ping)
+ public ActionResult SyncPlayPing([FromQuery] double ping)
{
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
var syncPlayRequest = new PlaybackRequest()
diff --git a/Jellyfin.Api/Controllers/SystemController.cs b/Jellyfin.Api/Controllers/SystemController.cs
index bc606f7aa..e0bce3a41 100644
--- a/Jellyfin.Api/Controllers/SystemController.cs
+++ b/Jellyfin.Api/Controllers/SystemController.cs
@@ -85,8 +85,8 @@ namespace Jellyfin.Api.Controllers
/// </summary>
/// <response code="200">Information retrieved.</response>
/// <returns>The server name.</returns>
- [HttpGet("Ping")]
- [HttpPost("Ping")]
+ [HttpGet("Ping", Name = "GetPingSystem")]
+ [HttpPost("Ping", Name = "PostPingSystem")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<string> PingSystem()
{
diff --git a/Jellyfin.Api/Controllers/TrailersController.cs b/Jellyfin.Api/Controllers/TrailersController.cs
index 645495551..fbab7948f 100644
--- a/Jellyfin.Api/Controllers/TrailersController.cs
+++ b/Jellyfin.Api/Controllers/TrailersController.cs
@@ -1,14 +1,10 @@
using System;
using Jellyfin.Api.Constants;
-using MediaBrowser.Controller.Dto;
-using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Querying;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Logging;
namespace Jellyfin.Api.Controllers
{
@@ -18,32 +14,15 @@ namespace Jellyfin.Api.Controllers
[Authorize(Policy = Policies.DefaultAuthorization)]
public class TrailersController : BaseJellyfinApiController
{
- private readonly IUserManager _userManager;
- private readonly ILibraryManager _libraryManager;
- private readonly ILogger<ItemsController> _logger;
- private readonly IDtoService _dtoService;
- private readonly ILocalizationManager _localizationManager;
+ private readonly ItemsController _itemsController;
/// <summary>
/// Initializes a new instance of the <see cref="TrailersController"/> class.
/// </summary>
- /// <param name="loggerFactory">Instance of the <see cref="ILoggerFactory"/> interface.</param>
- /// <param name="userManager">Instance of the <see cref="IUserManager"/> interface.</param>
- /// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param>
- /// <param name="dtoService">Instance of the <see cref="IDtoService"/> interface.</param>
- /// <param name="localizationManager">Instance of the <see cref="ILocalizationManager"/> interface.</param>
- public TrailersController(
- ILoggerFactory loggerFactory,
- IUserManager userManager,
- ILibraryManager libraryManager,
- IDtoService dtoService,
- ILocalizationManager localizationManager)
+ /// <param name="itemsController">Instance of <see cref="ItemsController"/>.</param>
+ public TrailersController(ItemsController itemsController)
{
- _userManager = userManager;
- _libraryManager = libraryManager;
- _dtoService = dtoService;
- _localizationManager = localizationManager;
- _logger = loggerFactory.CreateLogger<ItemsController>();
+ _itemsController = itemsController;
}
/// <summary>
@@ -214,12 +193,7 @@ namespace Jellyfin.Api.Controllers
{
var includeItemTypes = "Trailer";
- return new ItemsController(
- _userManager,
- _libraryManager,
- _localizationManager,
- _dtoService,
- _logger)
+ return _itemsController
.GetItems(
userId,
userId,
diff --git a/Jellyfin.Api/Controllers/UniversalAudioController.cs b/Jellyfin.Api/Controllers/UniversalAudioController.cs
index 87d9a611a..5a9bec2b0 100644
--- a/Jellyfin.Api/Controllers/UniversalAudioController.cs
+++ b/Jellyfin.Api/Controllers/UniversalAudioController.cs
@@ -7,21 +7,12 @@ using System.Threading.Tasks;
using Jellyfin.Api.Constants;
using Jellyfin.Api.Helpers;
using Jellyfin.Api.Models.VideoDtos;
-using MediaBrowser.Common.Net;
-using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Controller.Devices;
-using MediaBrowser.Controller.Dlna;
-using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Dlna;
-using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Logging;
namespace Jellyfin.Api.Controllers
{
@@ -30,72 +21,28 @@ namespace Jellyfin.Api.Controllers
/// </summary>
public class UniversalAudioController : BaseJellyfinApiController
{
- private readonly ILoggerFactory _loggerFactory;
- private readonly IUserManager _userManager;
- private readonly ILibraryManager _libraryManager;
- private readonly IDeviceManager _deviceManager;
- private readonly IDlnaManager _dlnaManager;
- private readonly IMediaEncoder _mediaEncoder;
- private readonly IFileSystem _fileSystem;
- private readonly IMediaSourceManager _mediaSourceManager;
private readonly IAuthorizationContext _authorizationContext;
- private readonly INetworkManager _networkManager;
- private readonly IServerConfigurationManager _serverConfigurationManager;
- private readonly TranscodingJobHelper _transcodingJobHelper;
- private readonly IConfiguration _configuration;
- private readonly ISubtitleEncoder _subtitleEncoder;
- private readonly IHttpClientFactory _httpClientFactory;
+ private readonly MediaInfoController _mediaInfoController;
+ private readonly DynamicHlsController _dynamicHlsController;
+ private readonly AudioController _audioController;
/// <summary>
/// Initializes a new instance of the <see cref="UniversalAudioController"/> class.
/// </summary>
- /// <param name="loggerFactory">Instance of the <see cref="ILoggerFactory"/> interface.</param>
- /// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface.</param>
- /// <param name="userManager">Instance of the <see cref="IUserManager"/> interface.</param>
- /// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param>
- /// <param name="mediaEncoder">Instance of the <see cref="IMediaEncoder"/> interface.</param>
- /// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>
- /// <param name="dlnaManager">Instance of the <see cref="IDlnaManager"/> interface.</param>
- /// <param name="deviceManager">Instance of the <see cref="IDeviceManager"/> interface.</param>
- /// <param name="mediaSourceManager">Instance of the <see cref="IMediaSourceManager"/> interface.</param>
/// <param name="authorizationContext">Instance of the <see cref="IAuthorizationContext"/> interface.</param>
- /// <param name="networkManager">Instance of the <see cref="INetworkManager"/> interface.</param>
- /// <param name="transcodingJobHelper">Instance of the <see cref="TranscodingJobHelper"/> interface.</param>
- /// <param name="configuration">Instance of the <see cref="IConfiguration"/> interface.</param>
- /// <param name="subtitleEncoder">Instance of the <see cref="ISubtitleEncoder"/> interface.</param>
- /// <param name="httpClientFactory">Instance of the <see cref="IHttpClientFactory"/> interface.</param>
+ /// <param name="mediaInfoController">Instance of the <see cref="MediaInfoController"/>.</param>
+ /// <param name="dynamicHlsController">Instance of the <see cref="DynamicHlsController"/>.</param>
+ /// <param name="audioController">Instance of the <see cref="AudioController"/>.</param>
public UniversalAudioController(
- ILoggerFactory loggerFactory,
- IServerConfigurationManager serverConfigurationManager,
- IUserManager userManager,
- ILibraryManager libraryManager,
- IMediaEncoder mediaEncoder,
- IFileSystem fileSystem,
- IDlnaManager dlnaManager,
- IDeviceManager deviceManager,
- IMediaSourceManager mediaSourceManager,
IAuthorizationContext authorizationContext,
- INetworkManager networkManager,
- TranscodingJobHelper transcodingJobHelper,
- IConfiguration configuration,
- ISubtitleEncoder subtitleEncoder,
- IHttpClientFactory httpClientFactory)
+ MediaInfoController mediaInfoController,
+ DynamicHlsController dynamicHlsController,
+ AudioController audioController)
{
- _userManager = userManager;
- _libraryManager = libraryManager;
- _mediaEncoder = mediaEncoder;
- _fileSystem = fileSystem;
- _dlnaManager = dlnaManager;
- _deviceManager = deviceManager;
- _mediaSourceManager = mediaSourceManager;
_authorizationContext = authorizationContext;
- _networkManager = networkManager;
- _loggerFactory = loggerFactory;
- _serverConfigurationManager = serverConfigurationManager;
- _transcodingJobHelper = transcodingJobHelper;
- _configuration = configuration;
- _subtitleEncoder = subtitleEncoder;
- _httpClientFactory = httpClientFactory;
+ _mediaInfoController = mediaInfoController;
+ _dynamicHlsController = dynamicHlsController;
+ _audioController = audioController;
}
/// <summary>
@@ -122,9 +69,9 @@ namespace Jellyfin.Api.Controllers
/// <response code="302">Redirected to remote audio stream.</response>
/// <returns>A <see cref="Task"/> containing the audio file.</returns>
[HttpGet("/Audio/{itemId}/universal")]
- [HttpGet("/Audio/{itemId}/{universal=universal}.{container?}")]
- [HttpHead("/Audio/{itemId}/universal")]
- [HttpHead("/Audio/{itemId}/{universal=universal}.{container?}")]
+ [HttpGet("/Audio/{itemId}/{universal=universal}.{container?}", Name = "GetUniversalAudioStream_2")]
+ [HttpHead("/Audio/{itemId}/universal", Name = "HeadUniversalAudioStream")]
+ [HttpHead("/Audio/{itemId}/{universal=universal}.{container?}", Name = "HeadUniversalAudioStream_2")]
[Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status302Found)]
@@ -151,8 +98,7 @@ namespace Jellyfin.Api.Controllers
var deviceProfile = GetDeviceProfile(container, transcodingContainer, audioCodec, transcodingProtocol, breakOnNonKeyFrames, transcodingAudioChannels, maxAudioSampleRate, maxAudioBitDepth, maxAudioChannels);
_authorizationContext.GetAuthorizationInfo(Request).DeviceId = deviceId;
- var mediaInfoController = new MediaInfoController(_mediaSourceManager, _deviceManager, _libraryManager, _networkManager, _mediaEncoder, _userManager, _authorizationContext, _loggerFactory.CreateLogger<MediaInfoController>(), _serverConfigurationManager);
- var playbackInfoResult = await mediaInfoController.GetPostedPlaybackInfo(
+ var playbackInfoResult = await _mediaInfoController.GetPostedPlaybackInfo(
itemId,
userId,
maxStreamingBitrate,
@@ -180,21 +126,6 @@ namespace Jellyfin.Api.Controllers
var isStatic = mediaSource.SupportsDirectStream;
if (!isStatic && string.Equals(mediaSource.TranscodingSubProtocol, "hls", StringComparison.OrdinalIgnoreCase))
{
- var dynamicHlsController = new DynamicHlsController(
- _libraryManager,
- _userManager,
- _dlnaManager,
- _authorizationContext,
- _mediaSourceManager,
- _serverConfigurationManager,
- _mediaEncoder,
- _fileSystem,
- _subtitleEncoder,
- _configuration,
- _deviceManager,
- _transcodingJobHelper,
- _networkManager,
- _loggerFactory.CreateLogger<DynamicHlsController>());
var transcodingProfile = deviceProfile.TranscodingProfiles[0];
// hls segment container can only be mpegts or fmp4 per ffmpeg documentation
@@ -203,10 +134,10 @@ namespace Jellyfin.Api.Controllers
if (isHeadRequest)
{
- dynamicHlsController.Request.Method = HttpMethod.Head.Method;
+ _dynamicHlsController.Request.Method = HttpMethod.Head.Method;
}
- return await dynamicHlsController.GetMasterHlsAudioPlaylist(
+ return await _dynamicHlsController.GetMasterHlsAudioPlaylist(
itemId,
".m3u8",
isStatic,
@@ -261,27 +192,12 @@ namespace Jellyfin.Api.Controllers
}
else
{
- var audioController = new AudioController(
- _dlnaManager,
- _userManager,
- _authorizationContext,
- _libraryManager,
- _mediaSourceManager,
- _serverConfigurationManager,
- _mediaEncoder,
- _fileSystem,
- _subtitleEncoder,
- _configuration,
- _deviceManager,
- _transcodingJobHelper,
- _httpClientFactory);
-
if (isHeadRequest)
{
- audioController.Request.Method = HttpMethod.Head.Method;
+ _audioController.Request.Method = HttpMethod.Head.Method;
}
- return await audioController.GetAudioStream(
+ return await _audioController.GetAudioStream(
itemId,
isStatic ? null : ("." + mediaSource.TranscodingContainer),
isStatic,
diff --git a/Jellyfin.Api/Controllers/VideoHlsController.cs b/Jellyfin.Api/Controllers/VideoHlsController.cs
index 3f8a2048e..8520dd163 100644
--- a/Jellyfin.Api/Controllers/VideoHlsController.cs
+++ b/Jellyfin.Api/Controllers/VideoHlsController.cs
@@ -49,7 +49,7 @@ namespace Jellyfin.Api.Controllers
private readonly IConfiguration _configuration;
private readonly IDeviceManager _deviceManager;
private readonly TranscodingJobHelper _transcodingJobHelper;
- private readonly ILogger _logger;
+ private readonly ILogger<VideoHlsController> _logger;
private readonly EncodingOptions _encodingOptions;
/// <summary>
diff --git a/Jellyfin.Api/Controllers/VideosController.cs b/Jellyfin.Api/Controllers/VideosController.cs
index d1ef817eb..ebe88a9c0 100644
--- a/Jellyfin.Api/Controllers/VideosController.cs
+++ b/Jellyfin.Api/Controllers/VideosController.cs
@@ -316,10 +316,10 @@ namespace Jellyfin.Api.Controllers
/// <param name="streamOptions">Optional. The streaming options.</param>
/// <response code="200">Video stream returned.</response>
/// <returns>A <see cref="FileResult"/> containing the audio file.</returns>
- [HttpGet("{itemId}/{stream=stream}.{container?}")]
+ [HttpGet("{itemId}/{stream=stream}.{container?}", Name = "GetVideoStream_2")]
[HttpGet("{itemId}/stream")]
- [HttpHead("{itemId}/{stream=stream}.{container?}")]
- [HttpHead("{itemId}/stream")]
+ [HttpHead("{itemId}/{stream=stream}.{container?}", Name = "HeadVideoStream_2")]
+ [HttpHead("{itemId}/stream", Name = "HeadVideoStream")]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<ActionResult> GetVideoStream(
[FromRoute] Guid itemId,