From 9996afbf25ee7025bd7d0d7bceb0dbd75253b6d7 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 22 Jul 2020 10:20:51 +0200 Subject: [PATCH] Add response code documentation --- .../Controllers/SyncPlayController.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Jellyfin.Api/Controllers/SyncPlayController.cs b/Jellyfin.Api/Controllers/SyncPlayController.cs index c0544091c5..3f40c7309b 100644 --- a/Jellyfin.Api/Controllers/SyncPlayController.cs +++ b/Jellyfin.Api/Controllers/SyncPlayController.cs @@ -9,6 +9,7 @@ using MediaBrowser.Controller.Session; using MediaBrowser.Controller.SyncPlay; using MediaBrowser.Model.SyncPlay; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace Jellyfin.Api.Controllers @@ -42,8 +43,10 @@ namespace Jellyfin.Api.Controllers /// /// Create a new SyncPlay group. /// + /// New group created. /// A indicating success. [HttpPost("New")] + [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult CreateNewGroup() { var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request); @@ -55,8 +58,10 @@ namespace Jellyfin.Api.Controllers /// Join an existing SyncPlay group. /// /// The sync play group id. + /// Group join successful. /// A indicating success. [HttpPost("Join")] + [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult JoinGroup([FromQuery, Required] Guid groupId) { var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request); @@ -73,8 +78,10 @@ namespace Jellyfin.Api.Controllers /// /// Leave the joined SyncPlay group. /// + /// Group leave successful. /// A indicating success. [HttpPost("Leave")] + [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult LeaveGroup() { var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request); @@ -86,8 +93,10 @@ namespace Jellyfin.Api.Controllers /// Gets all SyncPlay groups. /// /// Optional. Filter by item id. + /// Groups returned. /// An containing the available SyncPlay groups. [HttpGet("List")] + [ProducesResponseType(StatusCodes.Status200OK)] public ActionResult> GetSyncPlayGroups([FromQuery] Guid? filterItemId) { var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request); @@ -97,8 +106,10 @@ namespace Jellyfin.Api.Controllers /// /// Request play in SyncPlay group. /// + /// Play request sent to all group members. /// A indicating success. [HttpPost] + [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult Play() { var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request); @@ -113,8 +124,10 @@ namespace Jellyfin.Api.Controllers /// /// Request pause in SyncPlay group. /// + /// Pause request sent to all group members. /// A indicating success. [HttpPost] + [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult Pause() { var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request); @@ -130,8 +143,10 @@ namespace Jellyfin.Api.Controllers /// Request seek in SyncPlay group. /// /// The playback position in ticks. + /// Seek request sent to all group members. /// A indicating success. [HttpPost] + [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult Seek([FromQuery] long positionTicks) { var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request); @@ -150,8 +165,10 @@ namespace Jellyfin.Api.Controllers /// When the request has been made by the client. /// The playback position in ticks. /// Whether the buffering is done. + /// Buffering request sent to all group members. /// A indicating success. [HttpPost] + [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult Buffering([FromQuery] DateTime when, [FromQuery] long positionTicks, [FromQuery] bool bufferingDone) { var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request); @@ -169,8 +186,10 @@ namespace Jellyfin.Api.Controllers /// Update session ping. /// /// The ping. + /// Ping updated. /// A indicating success. [HttpPost] + [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult Ping([FromQuery] double ping) { var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);