aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/SessionController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Api/Controllers/SessionController.cs')
-rw-r--r--Jellyfin.Api/Controllers/SessionController.cs18
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
};