mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-08 04:18:06 +02:00
Update SessionController.cs
This commit is contained in:
parent
50060175b1
commit
7050525f6b
1 changed files with 9 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
#pragma warning disable CA1801
|
#pragma warning disable CA1801
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -150,7 +150,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// Instructs a session to play an item.
|
/// Instructs a session to play an item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sessionId">The session id.</param>
|
/// <param name="sessionId">The session id.</param>
|
||||||
/// <param name="command">The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now.</param>
|
/// <param name="playCommand">The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now.</param>
|
||||||
/// <param name="itemIds">The ids of the items to play, comma delimited.</param>
|
/// <param name="itemIds">The ids of the items to play, comma delimited.</param>
|
||||||
/// <param name="startPositionTicks">The starting position of the first item.</param>
|
/// <param name="startPositionTicks">The starting position of the first item.</param>
|
||||||
/// <response code="204">Instruction sent to session.</response>
|
/// <response code="204">Instruction sent to session.</response>
|
||||||
|
@ -160,15 +160,15 @@ namespace Jellyfin.Api.Controllers
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public ActionResult Play(
|
public ActionResult Play(
|
||||||
[FromRoute, Required] string sessionId,
|
[FromRoute, Required] string sessionId,
|
||||||
[FromQuery, Required] PlayRequest playRequest,
|
[FromQuery, Required] PlayCommand playCommand,
|
||||||
[FromQuery] string itemIds,
|
[FromQuery] Guid itemIds,
|
||||||
[FromQuery] long? startPositionTicks)
|
[FromQuery] long? startPositionTicks)
|
||||||
{
|
{
|
||||||
var playRequest = new PlayRequest
|
var playRequest = new PlayRequest
|
||||||
{
|
{
|
||||||
ItemIds = itemIds.Split(','),
|
ItemIds = new[] { itemIds },
|
||||||
StartPositionTicks = startPositionTicks,
|
StartPositionTicks = startPositionTicks,
|
||||||
PlayCommand = command
|
PlayCommand = playCommand
|
||||||
};
|
};
|
||||||
|
|
||||||
_sessionManager.SendPlayCommand(
|
_sessionManager.SendPlayCommand(
|
||||||
|
@ -184,6 +184,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// Issues a playstate command to a client.
|
/// Issues a playstate command to a client.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sessionId">The session id.</param>
|
/// <param name="sessionId">The session id.</param>
|
||||||
|
/// <param name="command">The <see cref="PlayCommand"/>.</param>
|
||||||
/// <param name="playstateRequest">The <see cref="PlaystateRequest"/>.</param>
|
/// <param name="playstateRequest">The <see cref="PlaystateRequest"/>.</param>
|
||||||
/// <response code="204">Playstate command sent to session.</response>
|
/// <response code="204">Playstate command sent to session.</response>
|
||||||
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
||||||
|
@ -192,7 +193,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public ActionResult SendPlaystateCommand(
|
public ActionResult SendPlaystateCommand(
|
||||||
[FromRoute, Required] string sessionId,
|
[FromRoute, Required] string sessionId,
|
||||||
[FromBody] PlaystateRequest playstateRequest)
|
[FromRoute, Required] PlayCommand command,
|
||||||
|
[FromQuery] PlaystateRequest playstateRequest)
|
||||||
{
|
{
|
||||||
_sessionManager.SendPlaystateCommand(
|
_sessionManager.SendPlaystateCommand(
|
||||||
RequestHelpers.GetSession(_sessionManager, _authContext, Request).Id,
|
RequestHelpers.GetSession(_sessionManager, _authContext, Request).Id,
|
||||||
|
|
Loading…
Reference in a new issue