From bc27c2b7da888b3fc9153cfb13dee8cc0e1b6622 Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Wed, 7 Apr 2021 14:36:08 +0200 Subject: Merge pull request #5631 from BrianCArnold/FixMessageCommand (cherry picked from commit a1718e392b4db4ba3123c52c3f654d3953a0e15f) Signed-off-by: Joshua M. Boniface --- Jellyfin.Api/Controllers/SessionController.cs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'Jellyfin.Api/Controllers/SessionController.cs') diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs index 0703d4255..7bd0b6918 100644 --- a/Jellyfin.Api/Controllers/SessionController.cs +++ b/Jellyfin.Api/Controllers/SessionController.cs @@ -313,9 +313,7 @@ namespace Jellyfin.Api.Controllers /// Issues a command to a client to display a message to the user. /// /// The session id. - /// The message test. - /// The message header. - /// The message timeout. If omitted the user will have to confirm viewing the message. + /// The object containing Header, Message Text, and TimeoutMs. /// Message sent. /// A . [HttpPost("Sessions/{sessionId}/Message")] @@ -323,16 +321,12 @@ namespace Jellyfin.Api.Controllers [ProducesResponseType(StatusCodes.Status204NoContent)] public 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"; + } _sessionManager.SendMessageCommand(RequestHelpers.GetSession(_sessionManager, _authContext, Request).Id, sessionId, command, CancellationToken.None); -- cgit v1.2.3