mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-15 21:43:03 +03:00
Merge branch 'master' into authenticationdb-efcore
# Conflicts: # Jellyfin.Api/Helpers/RequestHelpers.cs
This commit is contained in:
@@ -155,6 +155,10 @@ namespace Jellyfin.Api.Controllers
|
||||
/// <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="startPositionTicks">The starting position of the first item.</param>
|
||||
/// <param name="mediaSourceId">Optional. The media source id.</param>
|
||||
/// <param name="audioStreamIndex">Optional. The index of the audio stream to play.</param>
|
||||
/// <param name="subtitleStreamIndex">Optional. The index of the subtitle stream to play.</param>
|
||||
/// <param name="startIndex">Optional. The start index.</param>
|
||||
/// <response code="204">Instruction sent to session.</response>
|
||||
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
||||
[HttpPost("Sessions/{sessionId}/Playing")]
|
||||
@@ -164,13 +168,21 @@ namespace Jellyfin.Api.Controllers
|
||||
[FromRoute, Required] string sessionId,
|
||||
[FromQuery, Required] PlayCommand playCommand,
|
||||
[FromQuery, Required, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] Guid[] itemIds,
|
||||
[FromQuery] long? startPositionTicks)
|
||||
[FromQuery] long? startPositionTicks,
|
||||
[FromQuery] string? mediaSourceId,
|
||||
[FromQuery] int? audioStreamIndex,
|
||||
[FromQuery] int? subtitleStreamIndex,
|
||||
[FromQuery] int? startIndex)
|
||||
{
|
||||
var playRequest = new PlayRequest
|
||||
{
|
||||
ItemIds = itemIds,
|
||||
StartPositionTicks = startPositionTicks,
|
||||
PlayCommand = playCommand
|
||||
PlayCommand = playCommand,
|
||||
MediaSourceId = mediaSourceId,
|
||||
AudioStreamIndex = audioStreamIndex,
|
||||
SubtitleStreamIndex = subtitleStreamIndex,
|
||||
StartIndex = startIndex
|
||||
};
|
||||
|
||||
await _sessionManager.SendPlayCommand(
|
||||
@@ -308,9 +320,7 @@ namespace Jellyfin.Api.Controllers
|
||||
/// Issues a command to a client to display a message to the user.
|
||||
/// </summary>
|
||||
/// <param name="sessionId">The session id.</param>
|
||||
/// <param name="text">The message test.</param>
|
||||
/// <param name="header">The message header.</param>
|
||||
/// <param name="timeoutMs">The message timeout. If omitted the user will have to confirm viewing the message.</param>
|
||||
/// <param name="command">The <see cref="MessageCommand" /> object containing Header, Message Text, and TimeoutMs.</param>
|
||||
/// <response code="204">Message sent.</response>
|
||||
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
||||
[HttpPost("Sessions/{sessionId}/Message")]
|
||||
@@ -318,16 +328,12 @@ namespace Jellyfin.Api.Controllers
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public async Task<ActionResult> SendMessageCommand(
|
||||
[FromRoute, Required] string sessionId,
|
||||
[FromQuery, Required] string text,
|
||||
[FromQuery] string? header,
|
||||
[FromQuery] long? timeoutMs)
|
||||
[FromBody, Required] MessageCommand command)
|
||||
{
|
||||
var command = new MessageCommand
|
||||
if (string.IsNullOrWhiteSpace(command.Header))
|
||||
{
|
||||
Header = string.IsNullOrEmpty(header) ? "Message from Server" : header,
|
||||
TimeoutMs = timeoutMs,
|
||||
Text = text
|
||||
};
|
||||
command.Header = "Message from Server";
|
||||
}
|
||||
|
||||
await _sessionManager.SendMessageCommand(
|
||||
await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false),
|
||||
|
||||
Reference in New Issue
Block a user