diff options
| author | Niels van Velzen <git@ndat.nl> | 2020-09-21 17:49:45 +0200 |
|---|---|---|
| committer | Niels van Velzen <git@ndat.nl> | 2020-09-21 17:49:45 +0200 |
| commit | 891c538f818be7a339fcdfacaf34adb4a329d514 (patch) | |
| tree | 73ced8e2d0180ecf623dd15b8fabd7c6f4c5b4d1 /Jellyfin.Api/Controllers/SessionController.cs | |
| parent | 3459655bb401595f62c21513964876b2f4549fed (diff) | |
Use GeneralCommandType in SessionController parameters
Diffstat (limited to 'Jellyfin.Api/Controllers/SessionController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/SessionController.cs | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs index 5a2a3cdc0..c257a46dc 100644 --- a/Jellyfin.Api/Controllers/SessionController.cs +++ b/Jellyfin.Api/Controllers/SessionController.cs @@ -215,17 +215,12 @@ namespace Jellyfin.Api.Controllers [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult SendSystemCommand( [FromRoute, Required] string sessionId, - [FromRoute, Required] string command) + [FromRoute, Required] GeneralCommandType command) { - if (!Enum.TryParse(command, true, out GeneralCommandType commandType)) - { - return BadRequest(); - } - var currentSession = RequestHelpers.GetSession(_sessionManager, _authContext, Request); var generalCommand = new GeneralCommand { - Name = commandType, + Name = command, ControllingUserId = currentSession.UserId }; @@ -246,18 +241,13 @@ namespace Jellyfin.Api.Controllers [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult SendGeneralCommand( [FromRoute, Required] string sessionId, - [FromRoute, Required] string command) + [FromRoute, Required] GeneralCommandType command) { - if (!Enum.TryParse(command, true, out GeneralCommandType commandType)) - { - return BadRequest(); - } - var currentSession = RequestHelpers.GetSession(_sessionManager, _authContext, Request); var generalCommand = new GeneralCommand { - Name = commandType, + Name = command, ControllingUserId = currentSession.UserId }; |
