From 07e7125d07b8440ce01cabc65edec38e2dee0bf2 Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 21 Aug 2020 07:24:44 -0600 Subject: [PATCH] Fix dlna play to --- Jellyfin.Api/Controllers/SessionController.cs | 16 ++++++---------- MediaBrowser.Model/Session/PlayRequest.cs | 3 --- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs index 4795fb0cf7..ba8d515988 100644 --- a/Jellyfin.Api/Controllers/SessionController.cs +++ b/Jellyfin.Api/Controllers/SessionController.cs @@ -153,7 +153,6 @@ namespace Jellyfin.Api.Controllers /// The ids of the items to play, comma delimited. /// The starting position of the first item. /// The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now. - /// The . /// Instruction sent to session. /// A . [HttpPost("Sessions/{sessionId}/Playing")] @@ -163,17 +162,14 @@ namespace Jellyfin.Api.Controllers [FromRoute, Required] string? sessionId, [FromQuery] Guid[] itemIds, [FromQuery] long? startPositionTicks, - [FromQuery] PlayCommand playCommand, - [FromBody, Required] PlayRequest playRequest) + [FromQuery] PlayCommand playCommand) { - if (playRequest == null) + var playRequest = new PlayRequest { - throw new ArgumentException("Request Body may not be null"); - } - - playRequest.ItemIds = itemIds; - playRequest.StartPositionTicks = startPositionTicks; - playRequest.PlayCommand = playCommand; + ItemIds = itemIds, + StartPositionTicks = startPositionTicks, + PlayCommand = playCommand + }; _sessionManager.SendPlayCommand( RequestHelpers.GetSession(_sessionManager, _authContext, Request).Id, diff --git a/MediaBrowser.Model/Session/PlayRequest.cs b/MediaBrowser.Model/Session/PlayRequest.cs index d57bed171a..eeb25c2e89 100644 --- a/MediaBrowser.Model/Session/PlayRequest.cs +++ b/MediaBrowser.Model/Session/PlayRequest.cs @@ -15,21 +15,18 @@ namespace MediaBrowser.Model.Session /// Gets or sets the item ids. /// /// The item ids. - [ApiMember(Name = "ItemIds", Description = "The ids of the items to play, comma delimited", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST", AllowMultiple = true)] public Guid[] ItemIds { get; set; } /// /// Gets or sets the start position ticks that the first item should be played at. /// /// The start position ticks. - [ApiMember(Name = "StartPositionTicks", Description = "The starting position of the first item.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")] public long? StartPositionTicks { get; set; } /// /// Gets or sets the play command. /// /// The play command. - [ApiMember(Name = "PlayCommand", Description = "The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now.", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")] public PlayCommand PlayCommand { get; set; } ///