fix openapi validation errors
This commit is contained in:
parent
1535f363b2
commit
9e00aa3014
|
@ -144,10 +144,10 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="streamOptions">Optional. The streaming options.</param>
|
/// <param name="streamOptions">Optional. The streaming options.</param>
|
||||||
/// <response code="200">Audio stream returned.</response>
|
/// <response code="200">Audio stream returned.</response>
|
||||||
/// <returns>A <see cref="FileResult"/> containing the audio file.</returns>
|
/// <returns>A <see cref="FileResult"/> containing the audio file.</returns>
|
||||||
[HttpGet("{itemId}/{stream=stream}.{container?}")]
|
[HttpGet("{itemId}/{stream=stream}.{container?}", Name = "GetAudioStreamByContainer")]
|
||||||
[HttpGet("{itemId}/stream")]
|
[HttpGet("{itemId}/stream", Name = "GetAudioStream")]
|
||||||
[HttpHead("{itemId}/{stream=stream}.{container?}")]
|
[HttpHead("{itemId}/{stream=stream}.{container?}", Name = "HeadAudioStreamByContainer")]
|
||||||
[HttpHead("{itemId}/stream")]
|
[HttpHead("{itemId}/stream", Name = "HeadAudioStream")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public async Task<ActionResult> GetAudioStream(
|
public async Task<ActionResult> GetAudioStream(
|
||||||
[FromRoute] Guid itemId,
|
[FromRoute] Guid itemId,
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// or a <see cref="NoContentResult"/> if the css is not configured.
|
/// or a <see cref="NoContentResult"/> if the css is not configured.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpGet("Css")]
|
[HttpGet("Css")]
|
||||||
[HttpGet("Css.css")]
|
[HttpGet("Css.css", Name = "GetBrandingCss_2")]
|
||||||
[Produces("text/css")]
|
[Produces("text/css")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
|
|
|
@ -42,8 +42,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="serverId">Server UUID.</param>
|
/// <param name="serverId">Server UUID.</param>
|
||||||
/// <response code="200">Description xml returned.</response>
|
/// <response code="200">Description xml returned.</response>
|
||||||
/// <returns>An <see cref="OkResult"/> containing the description xml.</returns>
|
/// <returns>An <see cref="OkResult"/> containing the description xml.</returns>
|
||||||
[HttpGet("{serverId}/description.xml")]
|
|
||||||
[HttpGet("{serverId}/description")]
|
[HttpGet("{serverId}/description")]
|
||||||
|
[HttpGet("{serverId}/description.xml", Name = "GetDescriptionXml_2")]
|
||||||
[Produces(XMLContentType)]
|
[Produces(XMLContentType)]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public ActionResult GetDescriptionXml([FromRoute] string serverId)
|
public ActionResult GetDescriptionXml([FromRoute] string serverId)
|
||||||
|
@ -60,8 +60,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="serverId">Server UUID.</param>
|
/// <param name="serverId">Server UUID.</param>
|
||||||
/// <response code="200">Dlna content directory returned.</response>
|
/// <response code="200">Dlna content directory returned.</response>
|
||||||
/// <returns>An <see cref="OkResult"/> containing the dlna content directory xml.</returns>
|
/// <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")]
|
||||||
|
[HttpGet("{serverId}/ContentDirectory/ContentDirectory.xml", Name = "GetContentDirectory_2")]
|
||||||
[Produces(XMLContentType)]
|
[Produces(XMLContentType)]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
||||||
|
@ -75,8 +75,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serverId">Server UUID.</param>
|
/// <param name="serverId">Server UUID.</param>
|
||||||
/// <returns>Dlna media receiver registrar xml.</returns>
|
/// <returns>Dlna media receiver registrar xml.</returns>
|
||||||
[HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml")]
|
|
||||||
[HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar")]
|
[HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar")]
|
||||||
|
[HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml", Name = "GetMediaReceiverRegistrar_2")]
|
||||||
[Produces(XMLContentType)]
|
[Produces(XMLContentType)]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
||||||
|
@ -90,8 +90,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serverId">Server UUID.</param>
|
/// <param name="serverId">Server UUID.</param>
|
||||||
/// <returns>Dlna media receiver registrar xml.</returns>
|
/// <returns>Dlna media receiver registrar xml.</returns>
|
||||||
[HttpGet("{serverId}/ConnectionManager/ConnectionManager.xml")]
|
|
||||||
[HttpGet("{serverId}/ConnectionManager/ConnectionManager")]
|
[HttpGet("{serverId}/ConnectionManager/ConnectionManager")]
|
||||||
|
[HttpGet("{serverId}/ConnectionManager/ConnectionManager.xml", Name = "GetConnectionManager_2")]
|
||||||
[Produces(XMLContentType)]
|
[Produces(XMLContentType)]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
[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="serverId">Server UUID.</param>
|
||||||
/// <param name="fileName">The icon filename.</param>
|
/// <param name="fileName">The icon filename.</param>
|
||||||
/// <returns>Icon stream.</returns>
|
/// <returns>Icon stream.</returns>
|
||||||
[HttpGet("{serverId}/icons/{filename}")]
|
[HttpGet("{serverId}/icons/{fileName}")]
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
||||||
public ActionResult GetIconId([FromRoute] string serverId, [FromRoute] string fileName)
|
public ActionResult GetIconId([FromRoute] string serverId, [FromRoute] string fileName)
|
||||||
{
|
{
|
||||||
|
@ -193,7 +193,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="fileName">The icon filename.</param>
|
/// <param name="fileName">The icon filename.</param>
|
||||||
/// <returns>Icon stream.</returns>
|
/// <returns>Icon stream.</returns>
|
||||||
[HttpGet("icons/{filename}")]
|
[HttpGet("icons/{fileName}")]
|
||||||
public ActionResult GetIcon([FromRoute] string fileName)
|
public ActionResult GetIcon([FromRoute] string fileName)
|
||||||
{
|
{
|
||||||
return GetIconInternal(fileName);
|
return GetIconInternal(fileName);
|
||||||
|
|
|
@ -165,7 +165,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <response code="200">Video stream returned.</response>
|
/// <response code="200">Video stream returned.</response>
|
||||||
/// <returns>A <see cref="FileResult"/> containing the playlist file.</returns>
|
/// <returns>A <see cref="FileResult"/> containing the playlist file.</returns>
|
||||||
[HttpGet("/Videos/{itemId}/master.m3u8")]
|
[HttpGet("/Videos/{itemId}/master.m3u8")]
|
||||||
[HttpHead("/Videos/{itemId}/master.m3u8")]
|
[HttpHead("/Videos/{itemId}/master.m3u8", Name = "HeadMasterHlsVideoPlaylist")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public async Task<ActionResult> GetMasterHlsVideoPlaylist(
|
public async Task<ActionResult> GetMasterHlsVideoPlaylist(
|
||||||
[FromRoute] Guid itemId,
|
[FromRoute] Guid itemId,
|
||||||
|
@ -335,7 +335,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <response code="200">Audio stream returned.</response>
|
/// <response code="200">Audio stream returned.</response>
|
||||||
/// <returns>A <see cref="FileResult"/> containing the playlist file.</returns>
|
/// <returns>A <see cref="FileResult"/> containing the playlist file.</returns>
|
||||||
[HttpGet("/Audio/{itemId}/master.m3u8")]
|
[HttpGet("/Audio/{itemId}/master.m3u8")]
|
||||||
[HttpHead("/Audio/{itemId}/master.m3u8")]
|
[HttpHead("/Audio/{itemId}/master.m3u8", Name = "HeadMasterHlsAudioPlaylist")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public async Task<ActionResult> GetMasterHlsAudioPlaylist(
|
public async Task<ActionResult> GetMasterHlsAudioPlaylist(
|
||||||
[FromRoute] Guid itemId,
|
[FromRoute] Guid itemId,
|
||||||
|
|
|
@ -50,8 +50,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <returns>A <see cref="FileStreamResult"/> containing the audio stream.</returns>
|
/// <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
|
// Can't require authentication just yet due to seeing some requests come from Chrome without full query string
|
||||||
// [Authenticated]
|
// [Authenticated]
|
||||||
[HttpGet("/Audio/{itemId}/hls/{segmentId}/stream.mp3")]
|
[HttpGet("/Audio/{itemId}/hls/{segmentId}/stream.mp3", Name = "GetHlsAudioSegmentLegacyMp3")]
|
||||||
[HttpGet("/Audio/{itemId}/hls/{segmentId}/stream.aac")]
|
[HttpGet("/Audio/{itemId}/hls/{segmentId}/stream.aac", Name = "GetHlsAudioSegmentLegacyAac")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "itemId", Justification = "Required for ServiceStack")]
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "itemId", Justification = "Required for ServiceStack")]
|
||||||
public ActionResult GetHlsAudioSegmentLegacy([FromRoute] string itemId, [FromRoute] string segmentId)
|
public ActionResult GetHlsAudioSegmentLegacy([FromRoute] string itemId, [FromRoute] string segmentId)
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <response code="403">User does not have permission to delete the image.</response>
|
/// <response code="403">User does not have permission to delete the image.</response>
|
||||||
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
||||||
[HttpPost("/Users/{userId}/Images/{imageType}")]
|
[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.Status204NoContent)]
|
||||||
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "imageType", Justification = "Imported from ServiceStack")]
|
[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>
|
/// <response code="403">User does not have permission to delete the image.</response>
|
||||||
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
||||||
[HttpDelete("/Users/{userId}/Images/{itemType}")]
|
[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 = "imageType", Justification = "Imported from ServiceStack")]
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "index", Justification = "Imported from ServiceStack")]
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "index", Justification = "Imported from ServiceStack")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
|
@ -167,7 +167,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <response code="404">Item not found.</response>
|
/// <response code="404">Item not found.</response>
|
||||||
/// <returns>A <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if item not found.</returns>
|
/// <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}")]
|
||||||
[HttpDelete("/Items/{itemId}/Images/{imageType}/{imageIndex?}")]
|
[HttpDelete("/Items/{itemId}/Images/{imageType}/{imageIndex?}", Name = "DeleteItemImage_2")]
|
||||||
[Authorize(Policy = Policies.RequiresElevation)]
|
[Authorize(Policy = Policies.RequiresElevation)]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
@ -196,7 +196,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <response code="404">Item not found.</response>
|
/// <response code="404">Item not found.</response>
|
||||||
/// <returns>A <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if item not found.</returns>
|
/// <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}")]
|
||||||
[HttpPost("/Items/{itemId}/Images/{imageType}/{imageIndex?}")]
|
[HttpPost("/Items/{itemId}/Images/{imageType}/{imageIndex?}", Name = "SetItemImage_2")]
|
||||||
[Authorize(Policy = Policies.RequiresElevation)]
|
[Authorize(Policy = Policies.RequiresElevation)]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
@ -342,9 +342,9 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// or a <see cref="NotFoundResult"/> if item not found.
|
/// or a <see cref="NotFoundResult"/> if item not found.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpGet("/Items/{itemId}/Images/{imageType}")]
|
[HttpGet("/Items/{itemId}/Images/{imageType}")]
|
||||||
[HttpHead("/Items/{itemId}/Images/{imageType}")]
|
[HttpHead("/Items/{itemId}/Images/{imageType}", Name = "HeadItemImage")]
|
||||||
[HttpGet("/Items/{itemId}/Images/{imageType}/{imageIndex?}")]
|
[HttpGet("/Items/{itemId}/Images/{imageType}/{imageIndex?}", Name = "GetItemImage_2")]
|
||||||
[HttpHead("/Items/{itemId}/Images/{imageType}/{imageIndex?}")]
|
[HttpHead("/Items/{itemId}/Images/{imageType}/{imageIndex?}", Name = "HeadItemImage_2")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
public async Task<ActionResult> GetItemImage(
|
public async Task<ActionResult> GetItemImage(
|
||||||
|
@ -422,7 +422,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// or a <see cref="NotFoundResult"/> if item not found.
|
/// or a <see cref="NotFoundResult"/> if item not found.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpGet("/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}")]
|
[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.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
public async Task<ActionResult> GetItemImage2(
|
public async Task<ActionResult> GetItemImage2(
|
||||||
|
@ -500,7 +500,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// or a <see cref="NotFoundResult"/> if item not found.
|
/// or a <see cref="NotFoundResult"/> if item not found.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpGet("/Artists/{name}/Images/{imageType}/{imageIndex?}")]
|
[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.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
public async Task<ActionResult> GetArtistImage(
|
public async Task<ActionResult> GetArtistImage(
|
||||||
|
@ -578,7 +578,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// or a <see cref="NotFoundResult"/> if item not found.
|
/// or a <see cref="NotFoundResult"/> if item not found.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpGet("/Genres/{name}/Images/{imageType}/{imageIndex?}")]
|
[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.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
public async Task<ActionResult> GetGenreImage(
|
public async Task<ActionResult> GetGenreImage(
|
||||||
|
@ -656,7 +656,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// or a <see cref="NotFoundResult"/> if item not found.
|
/// or a <see cref="NotFoundResult"/> if item not found.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpGet("/MusicGenres/{name}/Images/{imageType}/{imageIndex?}")]
|
[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.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
public async Task<ActionResult> GetMusicGenreImage(
|
public async Task<ActionResult> GetMusicGenreImage(
|
||||||
|
@ -734,7 +734,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// or a <see cref="NotFoundResult"/> if item not found.
|
/// or a <see cref="NotFoundResult"/> if item not found.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpGet("/Persons/{name}/Images/{imageType}/{imageIndex?}")]
|
[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.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
public async Task<ActionResult> GetPersonImage(
|
public async Task<ActionResult> GetPersonImage(
|
||||||
|
@ -812,7 +812,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// or a <see cref="NotFoundResult"/> if item not found.
|
/// or a <see cref="NotFoundResult"/> if item not found.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpGet("/Studios/{name}/Images/{imageType}/{imageIndex?}")]
|
[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.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
public async Task<ActionResult> GetStudioImage(
|
public async Task<ActionResult> GetStudioImage(
|
||||||
|
@ -890,7 +890,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// or a <see cref="NotFoundResult"/> if item not found.
|
/// or a <see cref="NotFoundResult"/> if item not found.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpGet("/Users/{userId}/Images/{imageType}/{imageIndex?}")]
|
[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.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
public async Task<ActionResult> GetUserImage(
|
public async Task<ActionResult> GetUserImage(
|
||||||
|
|
|
@ -140,7 +140,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="enableImages">Optional, include image information in output.</param>
|
/// <param name="enableImages">Optional, include image information in output.</param>
|
||||||
/// <returns>A <see cref="QueryResult{BaseItemDto}"/> with the items.</returns>
|
/// <returns>A <see cref="QueryResult{BaseItemDto}"/> with the items.</returns>
|
||||||
[HttpGet("/Items")]
|
[HttpGet("/Items")]
|
||||||
[HttpGet("/Users/{uId}/Items")]
|
[HttpGet("/Users/{uId}/Items", Name = "GetItems_2")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public ActionResult<QueryResult<BaseItemDto>> GetItems(
|
public ActionResult<QueryResult<BaseItemDto>> GetItems(
|
||||||
[FromRoute] Guid? uId,
|
[FromRoute] Guid? uId,
|
||||||
|
|
|
@ -521,7 +521,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="tvdbId">The tvdbId.</param>
|
/// <param name="tvdbId">The tvdbId.</param>
|
||||||
/// <response code="204">Report success.</response>
|
/// <response code="204">Report success.</response>
|
||||||
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
||||||
[HttpPost("/Library/Series/Added")]
|
[HttpPost("/Library/Series/Added", Name = "PostAddedSeries")]
|
||||||
[HttpPost("/Library/Series/Updated")]
|
[HttpPost("/Library/Series/Updated")]
|
||||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
|
@ -551,7 +551,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="imdbId">The imdbId.</param>
|
/// <param name="imdbId">The imdbId.</param>
|
||||||
/// <response code="204">Report success.</response>
|
/// <response code="204">Report success.</response>
|
||||||
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
||||||
[HttpPost("/Library/Movies/Added")]
|
[HttpPost("/Library/Movies/Added", Name = "PostAddedMovies")]
|
||||||
[HttpPost("/Library/Movies/Updated")]
|
[HttpPost("/Library/Movies/Updated")]
|
||||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[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>
|
/// <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>
|
/// <response code="200">Similar items returned.</response>
|
||||||
/// <returns>A <see cref="QueryResult{BaseItemDto}"/> containing the similar items.</returns>
|
/// <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("/Items/{itemId}/Similar")]
|
||||||
[HttpGet("/Albums/{itemId}/Similar")]
|
[HttpGet("/Albums/{itemId}/Similar", Name = "GetSimilarAlbums2")]
|
||||||
[HttpGet("/Shows/{itemId}/Similar")]
|
[HttpGet("/Shows/{itemId}/Similar", Name = "GetSimilarShows2")]
|
||||||
[HttpGet("/Movies/{itemId}/Similar")]
|
[HttpGet("/Movies/{itemId}/Similar", Name = "GetSimilarMovies2")]
|
||||||
[HttpGet("/Trailers/{itemId}/Similar")]
|
[HttpGet("/Trailers/{itemId}/Similar", Name = "GetSimilarTrailers2")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public ActionResult<QueryResult<BaseItemDto>> GetSimilarItems(
|
public ActionResult<QueryResult<BaseItemDto>> GetSimilarItems(
|
||||||
[FromRoute] Guid itemId,
|
[FromRoute] Guid itemId,
|
||||||
|
|
|
@ -127,7 +127,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
[HttpGet("Channels")]
|
[HttpGet("Channels")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||||
public ActionResult<QueryResult<BaseItemDto>> GetChannels(
|
public ActionResult<QueryResult<BaseItemDto>> GetLiveTvChannels(
|
||||||
[FromQuery] ChannelType? type,
|
[FromQuery] ChannelType? type,
|
||||||
[FromQuery] Guid? userId,
|
[FromQuery] Guid? userId,
|
||||||
[FromQuery] int? startIndex,
|
[FromQuery] int? startIndex,
|
||||||
|
@ -535,7 +535,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
[HttpGet("Programs")]
|
[HttpGet("Programs")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||||
public async Task<ActionResult<QueryResult<BaseItemDto>>> GetPrograms(
|
public async Task<ActionResult<QueryResult<BaseItemDto>>> GetLiveTvPrograms(
|
||||||
[FromQuery] string? channelIds,
|
[FromQuery] string? channelIds,
|
||||||
[FromQuery] Guid? userId,
|
[FromQuery] Guid? userId,
|
||||||
[FromQuery] DateTime? minStartDate,
|
[FromQuery] DateTime? minStartDate,
|
||||||
|
@ -933,7 +933,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
[Obsolete("This endpoint is obsolete.")]
|
[Obsolete("This endpoint is obsolete.")]
|
||||||
public ActionResult<BaseItemDto> GetRecordingGroup([FromQuery] Guid? groupId)
|
public ActionResult<BaseItemDto> GetRecordingGroup([FromRoute] Guid? groupId)
|
||||||
{
|
{
|
||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,7 +241,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="command">The command to send.</param>
|
/// <param name="command">The command to send.</param>
|
||||||
/// <response code="204">General command sent to session.</response>
|
/// <response code="204">General command sent to session.</response>
|
||||||
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
||||||
[HttpPost("/Sessions/{sessionId}/Command/{Command}")]
|
[HttpPost("/Sessions/{sessionId}/Command/{command}")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public ActionResult SendGeneralCommand(
|
public ActionResult SendGeneralCommand(
|
||||||
[FromRoute] string? sessionId,
|
[FromRoute] string? sessionId,
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <response code="200">Initial user retrieved.</response>
|
/// <response code="200">Initial user retrieved.</response>
|
||||||
/// <returns>The first user.</returns>
|
/// <returns>The first user.</returns>
|
||||||
[HttpGet("User")]
|
[HttpGet("User")]
|
||||||
[HttpGet("FirstUser")]
|
[HttpGet("FirstUser", Name = "GetFirstUser_2")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public async Task<StartupUserDto> GetFirstUser()
|
public async Task<StartupUserDto> GetFirstUser()
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpPost("User")]
|
[HttpPost("User")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<ActionResult> UpdateUser([FromForm] StartupUserDto startupUserDto)
|
public async Task<ActionResult> UpdateStartupUser([FromForm] StartupUserDto startupUserDto)
|
||||||
{
|
{
|
||||||
var user = _userManager.Users.First();
|
var user = _userManager.Users.First();
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <response code="200">File returned.</response>
|
/// <response code="200">File returned.</response>
|
||||||
/// <returns>A <see cref="FileContentResult"/> with the subtitle file.</returns>
|
/// <returns>A <see cref="FileContentResult"/> with the subtitle file.</returns>
|
||||||
[HttpGet("/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/Stream.{format}")]
|
[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)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public async Task<ActionResult> GetSubtitle(
|
public async Task<ActionResult> GetSubtitle(
|
||||||
[FromRoute, Required] Guid itemId,
|
[FromRoute, Required] Guid itemId,
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||||
[HttpPost("New")]
|
[HttpPost("New")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public ActionResult CreateNewGroup()
|
public ActionResult SyncPlayCreateGroup()
|
||||||
{
|
{
|
||||||
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
||||||
_syncPlayManager.NewGroup(currentSession, CancellationToken.None);
|
_syncPlayManager.NewGroup(currentSession, CancellationToken.None);
|
||||||
|
@ -62,7 +62,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||||
[HttpPost("Join")]
|
[HttpPost("Join")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public ActionResult JoinGroup([FromQuery, Required] Guid groupId)
|
public ActionResult SyncPlayJoinGroup([FromQuery, Required] Guid groupId)
|
||||||
{
|
{
|
||||||
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||||
[HttpPost("Leave")]
|
[HttpPost("Leave")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public ActionResult LeaveGroup()
|
public ActionResult SyncPlayLeaveGroup()
|
||||||
{
|
{
|
||||||
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
||||||
_syncPlayManager.LeaveGroup(currentSession, CancellationToken.None);
|
_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>
|
/// <returns>An <see cref="IEnumerable{GrouüInfoView}"/> containing the available SyncPlay groups.</returns>
|
||||||
[HttpGet("List")]
|
[HttpGet("List")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[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);
|
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
||||||
return Ok(_syncPlayManager.ListGroups(currentSession, filterItemId.HasValue ? filterItemId.Value : Guid.Empty));
|
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>
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||||
[HttpPost("Play")]
|
[HttpPost("Play")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public ActionResult Play()
|
public ActionResult SyncPlayPlay()
|
||||||
{
|
{
|
||||||
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
||||||
var syncPlayRequest = new PlaybackRequest()
|
var syncPlayRequest = new PlaybackRequest()
|
||||||
|
@ -128,7 +128,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||||
[HttpPost("Pause")]
|
[HttpPost("Pause")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public ActionResult Pause()
|
public ActionResult SyncPlayPause()
|
||||||
{
|
{
|
||||||
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
||||||
var syncPlayRequest = new PlaybackRequest()
|
var syncPlayRequest = new PlaybackRequest()
|
||||||
|
@ -147,7 +147,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||||
[HttpPost("Seek")]
|
[HttpPost("Seek")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public ActionResult Seek([FromQuery] long positionTicks)
|
public ActionResult SyncPlaySeek([FromQuery] long positionTicks)
|
||||||
{
|
{
|
||||||
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
||||||
var syncPlayRequest = new PlaybackRequest()
|
var syncPlayRequest = new PlaybackRequest()
|
||||||
|
@ -169,7 +169,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||||
[HttpPost("Buffering")]
|
[HttpPost("Buffering")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[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 currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
||||||
var syncPlayRequest = new PlaybackRequest()
|
var syncPlayRequest = new PlaybackRequest()
|
||||||
|
@ -190,7 +190,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||||
[HttpPost("Ping")]
|
[HttpPost("Ping")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public ActionResult Ping([FromQuery] double ping)
|
public ActionResult SyncPlayPing([FromQuery] double ping)
|
||||||
{
|
{
|
||||||
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);
|
||||||
var syncPlayRequest = new PlaybackRequest()
|
var syncPlayRequest = new PlaybackRequest()
|
||||||
|
|
|
@ -85,8 +85,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <response code="200">Information retrieved.</response>
|
/// <response code="200">Information retrieved.</response>
|
||||||
/// <returns>The server name.</returns>
|
/// <returns>The server name.</returns>
|
||||||
[HttpGet("Ping")]
|
[HttpGet("Ping", Name = "GetPingSystem")]
|
||||||
[HttpPost("Ping")]
|
[HttpPost("Ping", Name = "PostPingSystem")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public ActionResult<string> PingSystem()
|
public ActionResult<string> PingSystem()
|
||||||
{
|
{
|
||||||
|
|
|
@ -69,9 +69,9 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <response code="302">Redirected to remote audio stream.</response>
|
/// <response code="302">Redirected to remote audio stream.</response>
|
||||||
/// <returns>A <see cref="Task"/> containing the audio file.</returns>
|
/// <returns>A <see cref="Task"/> containing the audio file.</returns>
|
||||||
[HttpGet("/Audio/{itemId}/universal")]
|
[HttpGet("/Audio/{itemId}/universal")]
|
||||||
[HttpGet("/Audio/{itemId}/{universal=universal}.{container?}")]
|
[HttpGet("/Audio/{itemId}/{universal=universal}.{container?}", Name = "GetUniversalAudioStream_2")]
|
||||||
[HttpHead("/Audio/{itemId}/universal")]
|
[HttpHead("/Audio/{itemId}/universal", Name = "HeadUniversalAudioStream")]
|
||||||
[HttpHead("/Audio/{itemId}/{universal=universal}.{container?}")]
|
[HttpHead("/Audio/{itemId}/{universal=universal}.{container?}", Name = "HeadUniversalAudioStream_2")]
|
||||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status302Found)]
|
[ProducesResponseType(StatusCodes.Status302Found)]
|
||||||
|
|
|
@ -316,10 +316,10 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="streamOptions">Optional. The streaming options.</param>
|
/// <param name="streamOptions">Optional. The streaming options.</param>
|
||||||
/// <response code="200">Video stream returned.</response>
|
/// <response code="200">Video stream returned.</response>
|
||||||
/// <returns>A <see cref="FileResult"/> containing the audio file.</returns>
|
/// <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")]
|
[HttpGet("{itemId}/stream")]
|
||||||
[HttpHead("{itemId}/{stream=stream}.{container?}")]
|
[HttpHead("{itemId}/{stream=stream}.{container?}", Name = "HeadVideoStream_2")]
|
||||||
[HttpHead("{itemId}/stream")]
|
[HttpHead("{itemId}/stream", Name = "HeadVideoStream")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public async Task<ActionResult> GetVideoStream(
|
public async Task<ActionResult> GetVideoStream(
|
||||||
[FromRoute] Guid itemId,
|
[FromRoute] Guid itemId,
|
||||||
|
|
|
@ -198,8 +198,15 @@ namespace Jellyfin.Server.Extensions
|
||||||
$"{description.ActionDescriptor.RouteValues["controller"]}_{description.RelativePath}");
|
$"{description.ActionDescriptor.RouteValues["controller"]}_{description.RelativePath}");
|
||||||
|
|
||||||
// Use method name as operationId
|
// Use method name as operationId
|
||||||
c.CustomOperationIds(description =>
|
c.CustomOperationIds(
|
||||||
description.TryGetMethodInfo(out MethodInfo methodInfo) ? methodInfo.Name : null);
|
description =>
|
||||||
|
{
|
||||||
|
description.TryGetMethodInfo(out MethodInfo methodInfo);
|
||||||
|
// Attribute name, method name, none.
|
||||||
|
return description?.ActionDescriptor?.AttributeRouteInfo?.Name
|
||||||
|
?? methodInfo?.Name
|
||||||
|
?? null;
|
||||||
|
});
|
||||||
|
|
||||||
// TODO - remove when all types are supported in System.Text.Json
|
// TODO - remove when all types are supported in System.Text.Json
|
||||||
c.AddSwaggerTypeMappings();
|
c.AddSwaggerTypeMappings();
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
using MediaBrowser.Api;
|
|
||||||
using MediaBrowser.Controller.Configuration;
|
|
||||||
using MediaBrowser.Controller.Net;
|
|
||||||
using MediaBrowser.Model.Configuration;
|
|
||||||
using MediaBrowser.Model.Services;
|
|
||||||
using Microsoft.Extensions.Logging.Abstractions;
|
|
||||||
using Moq;
|
|
||||||
using Xunit;
|
|
||||||
|
|
||||||
namespace Jellyfin.Api.Tests
|
|
||||||
{
|
|
||||||
public class GetPathValueTests
|
|
||||||
{
|
|
||||||
[Theory]
|
|
||||||
[InlineData("https://localhost:8096/ScheduledTasks/1234/Triggers", "", 1, "1234")]
|
|
||||||
[InlineData("https://localhost:8096/emby/ScheduledTasks/1234/Triggers", "", 1, "1234")]
|
|
||||||
[InlineData("https://localhost:8096/mediabrowser/ScheduledTasks/1234/Triggers", "", 1, "1234")]
|
|
||||||
[InlineData("https://localhost:8096/jellyfin/2/ScheduledTasks/1234/Triggers", "jellyfin/2", 1, "1234")]
|
|
||||||
[InlineData("https://localhost:8096/jellyfin/2/emby/ScheduledTasks/1234/Triggers", "jellyfin/2", 1, "1234")]
|
|
||||||
[InlineData("https://localhost:8096/jellyfin/2/mediabrowser/ScheduledTasks/1234/Triggers", "jellyfin/2", 1, "1234")]
|
|
||||||
[InlineData("https://localhost:8096/JELLYFIN/2/ScheduledTasks/1234/Triggers", "jellyfin/2", 1, "1234")]
|
|
||||||
[InlineData("https://localhost:8096/JELLYFIN/2/Emby/ScheduledTasks/1234/Triggers", "jellyfin/2", 1, "1234")]
|
|
||||||
[InlineData("https://localhost:8096/JELLYFIN/2/MediaBrowser/ScheduledTasks/1234/Triggers", "jellyfin/2", 1, "1234")]
|
|
||||||
public void GetPathValueTest(string path, string baseUrl, int index, string value)
|
|
||||||
{
|
|
||||||
var reqMock = Mock.Of<IRequest>(x => x.PathInfo == path);
|
|
||||||
var conf = new ServerConfiguration()
|
|
||||||
{
|
|
||||||
BaseUrl = baseUrl
|
|
||||||
};
|
|
||||||
|
|
||||||
var confManagerMock = Mock.Of<IServerConfigurationManager>(x => x.Configuration == conf);
|
|
||||||
|
|
||||||
var service = new TestService(
|
|
||||||
new NullLogger<TestService>(),
|
|
||||||
confManagerMock,
|
|
||||||
Mock.Of<IHttpResultFactory>())
|
|
||||||
{
|
|
||||||
Request = reqMock
|
|
||||||
};
|
|
||||||
|
|
||||||
Assert.Equal(value, service.GetPathValue(index).ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user