mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 03:48:06 +02:00
Did the other API,
This commit is contained in:
parent
c98144c60d
commit
3d0b9f9ea1
1 changed files with 59 additions and 8 deletions
|
@ -145,13 +145,19 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <returns>Control response.</returns>
|
/// <returns>Control response.</returns>
|
||||||
[HttpPost("{serverId}/ContentDirectory/Control")]
|
[HttpPost("{serverId}/ContentDirectory/Control")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
[Produces(MediaTypeNames.Text.Xml)]
|
[Produces(MediaTypeNames.Text.Xml)]
|
||||||
[ProducesFile(MediaTypeNames.Text.Xml)]
|
[ProducesFile(MediaTypeNames.Text.Xml)]
|
||||||
public async Task<ActionResult<ControlResponse>> ProcessContentDirectoryControlRequest([FromRoute, Required] string serverId)
|
public async Task<ActionResult<ControlResponse>> ProcessContentDirectoryControlRequest([FromRoute, Required] string serverId)
|
||||||
|
{
|
||||||
|
if (DlnaEntryPoint.Enabled)
|
||||||
{
|
{
|
||||||
return await ProcessControlRequestInternalAsync(serverId, Request.Body, _contentDirectory).ConfigureAwait(false);
|
return await ProcessControlRequestInternalAsync(serverId, Request.Body, _contentDirectory).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Process a connection manager control request.
|
/// Process a connection manager control request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -160,13 +166,19 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <returns>Control response.</returns>
|
/// <returns>Control response.</returns>
|
||||||
[HttpPost("{serverId}/ConnectionManager/Control")]
|
[HttpPost("{serverId}/ConnectionManager/Control")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
[Produces(MediaTypeNames.Text.Xml)]
|
[Produces(MediaTypeNames.Text.Xml)]
|
||||||
[ProducesFile(MediaTypeNames.Text.Xml)]
|
[ProducesFile(MediaTypeNames.Text.Xml)]
|
||||||
public async Task<ActionResult<ControlResponse>> ProcessConnectionManagerControlRequest([FromRoute, Required] string serverId)
|
public async Task<ActionResult<ControlResponse>> ProcessConnectionManagerControlRequest([FromRoute, Required] string serverId)
|
||||||
|
{
|
||||||
|
if (DlnaEntryPoint.Enabled)
|
||||||
{
|
{
|
||||||
return await ProcessControlRequestInternalAsync(serverId, Request.Body, _connectionManager).ConfigureAwait(false);
|
return await ProcessControlRequestInternalAsync(serverId, Request.Body, _connectionManager).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Process a media receiver registrar control request.
|
/// Process a media receiver registrar control request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -180,10 +192,15 @@ namespace Jellyfin.Api.Controllers
|
||||||
[Produces(MediaTypeNames.Text.Xml)]
|
[Produces(MediaTypeNames.Text.Xml)]
|
||||||
[ProducesFile(MediaTypeNames.Text.Xml)]
|
[ProducesFile(MediaTypeNames.Text.Xml)]
|
||||||
public async Task<ActionResult<ControlResponse>> ProcessMediaReceiverRegistrarControlRequest([FromRoute, Required] string serverId)
|
public async Task<ActionResult<ControlResponse>> ProcessMediaReceiverRegistrarControlRequest([FromRoute, Required] string serverId)
|
||||||
|
{
|
||||||
|
if (DlnaEntryPoint.Enabled)
|
||||||
{
|
{
|
||||||
return await ProcessControlRequestInternalAsync(serverId, Request.Body, _mediaReceiverRegistrar).ConfigureAwait(false);
|
return await ProcessControlRequestInternalAsync(serverId, Request.Body, _mediaReceiverRegistrar).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Processes an event subscription request.
|
/// Processes an event subscription request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -195,76 +212,110 @@ namespace Jellyfin.Api.Controllers
|
||||||
[ApiExplorerSettings(IgnoreApi = true)] // Ignore in openapi docs
|
[ApiExplorerSettings(IgnoreApi = true)] // Ignore in openapi docs
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
[Produces(MediaTypeNames.Text.Xml)]
|
[Produces(MediaTypeNames.Text.Xml)]
|
||||||
[ProducesFile(MediaTypeNames.Text.Xml)]
|
[ProducesFile(MediaTypeNames.Text.Xml)]
|
||||||
public ActionResult<EventSubscriptionResponse> ProcessMediaReceiverRegistrarEventRequest(string serverId)
|
public ActionResult<EventSubscriptionResponse> ProcessMediaReceiverRegistrarEventRequest(string serverId)
|
||||||
|
{
|
||||||
|
if (DlnaEntryPoint.Enabled)
|
||||||
{
|
{
|
||||||
return ProcessEventRequest(_mediaReceiverRegistrar);
|
return ProcessEventRequest(_mediaReceiverRegistrar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Processes an event subscription request.
|
/// Processes an event subscription request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serverId">Server UUID.</param>
|
/// <param name="serverId">Server UUID.</param>
|
||||||
/// <response code="200">Request processed.</response>
|
/// <response code="200">Request processed.</response>
|
||||||
|
/// <response code="404">Not found.</response>
|
||||||
/// <returns>Event subscription response.</returns>
|
/// <returns>Event subscription response.</returns>
|
||||||
[HttpSubscribe("{serverId}/ContentDirectory/Events")]
|
[HttpSubscribe("{serverId}/ContentDirectory/Events")]
|
||||||
[HttpUnsubscribe("{serverId}/ContentDirectory/Events")]
|
[HttpUnsubscribe("{serverId}/ContentDirectory/Events")]
|
||||||
[ApiExplorerSettings(IgnoreApi = true)] // Ignore in openapi docs
|
[ApiExplorerSettings(IgnoreApi = true)] // Ignore in openapi docs
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
[Produces(MediaTypeNames.Text.Xml)]
|
[Produces(MediaTypeNames.Text.Xml)]
|
||||||
[ProducesFile(MediaTypeNames.Text.Xml)]
|
[ProducesFile(MediaTypeNames.Text.Xml)]
|
||||||
public ActionResult<EventSubscriptionResponse> ProcessContentDirectoryEventRequest(string serverId)
|
public ActionResult<EventSubscriptionResponse> ProcessContentDirectoryEventRequest(string serverId)
|
||||||
|
{
|
||||||
|
if (DlnaEntryPoint.Enabled)
|
||||||
{
|
{
|
||||||
return ProcessEventRequest(_contentDirectory);
|
return ProcessEventRequest(_contentDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Processes an event subscription request.
|
/// Processes an event subscription request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serverId">Server UUID.</param>
|
/// <param name="serverId">Server UUID.</param>
|
||||||
/// <response code="200">Request processed.</response>
|
/// <response code="200">Request processed.</response>
|
||||||
|
/// <response code="404">Not found.</response>
|
||||||
/// <returns>Event subscription response.</returns>
|
/// <returns>Event subscription response.</returns>
|
||||||
[HttpSubscribe("{serverId}/ConnectionManager/Events")]
|
[HttpSubscribe("{serverId}/ConnectionManager/Events")]
|
||||||
[HttpUnsubscribe("{serverId}/ConnectionManager/Events")]
|
[HttpUnsubscribe("{serverId}/ConnectionManager/Events")]
|
||||||
[ApiExplorerSettings(IgnoreApi = true)] // Ignore in openapi docs
|
[ApiExplorerSettings(IgnoreApi = true)] // Ignore in openapi docs
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "serverId", Justification = "Required for DLNA")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
[Produces(MediaTypeNames.Text.Xml)]
|
[Produces(MediaTypeNames.Text.Xml)]
|
||||||
[ProducesFile(MediaTypeNames.Text.Xml)]
|
[ProducesFile(MediaTypeNames.Text.Xml)]
|
||||||
public ActionResult<EventSubscriptionResponse> ProcessConnectionManagerEventRequest(string serverId)
|
public ActionResult<EventSubscriptionResponse> ProcessConnectionManagerEventRequest(string serverId)
|
||||||
|
{
|
||||||
|
if (DlnaEntryPoint.Enabled)
|
||||||
{
|
{
|
||||||
return ProcessEventRequest(_connectionManager);
|
return ProcessEventRequest(_connectionManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a server icon.
|
/// Gets a server icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <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>
|
||||||
|
/// <response code="404">Not found.</response>
|
||||||
/// <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")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
[ProducesImageFile]
|
[ProducesImageFile]
|
||||||
public ActionResult GetIconId([FromRoute, Required] string serverId, [FromRoute, Required] string fileName)
|
public ActionResult GetIconId([FromRoute, Required] string serverId, [FromRoute, Required] string fileName)
|
||||||
|
{
|
||||||
|
if (DlnaEntryPoint.Enabled)
|
||||||
{
|
{
|
||||||
return GetIconInternal(fileName);
|
return GetIconInternal(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a server icon.
|
/// Gets a server icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="fileName">The icon filename.</param>
|
/// <param name="fileName">The icon filename.</param>
|
||||||
/// <returns>Icon stream.</returns>
|
/// <returns>Icon stream.</returns>
|
||||||
|
/// <response code="404">Not found.</response>
|
||||||
[HttpGet("icons/{fileName}")]
|
[HttpGet("icons/{fileName}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
[ProducesImageFile]
|
[ProducesImageFile]
|
||||||
public ActionResult GetIcon([FromRoute, Required] string fileName)
|
public ActionResult GetIcon([FromRoute, Required] string fileName)
|
||||||
|
{
|
||||||
|
if (DlnaEntryPoint.Enabled)
|
||||||
{
|
{
|
||||||
return GetIconInternal(fileName);
|
return GetIconInternal(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
private ActionResult GetIconInternal(string fileName)
|
private ActionResult GetIconInternal(string fileName)
|
||||||
{
|
{
|
||||||
var icon = _dlnaManager.GetIcon(fileName);
|
var icon = _dlnaManager.GetIcon(fileName);
|
||||||
|
|
Loading…
Reference in a new issue