diff options
| author | BrianCArnold <trenchie@trenchie.us> | 2021-03-30 07:29:40 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-30 07:29:40 -0400 |
| commit | 80fe48fda972eff0d6b58ac8a9e2f63d44a1b23e (patch) | |
| tree | 7c8944621ba3d3c8e07d3435fb7b5d0a67ab8808 /Jellyfin.Api/Controllers/SessionController.cs | |
| parent | 54107ae88262d835cac2d5a6f335b0c10d050b1a (diff) | |
Update SessionController.cs
Removed unnecessary construction of POCO to represent data from POST body
Diffstat (limited to 'Jellyfin.Api/Controllers/SessionController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/SessionController.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs index 14686222b..b64cbe30c 100644 --- a/Jellyfin.Api/Controllers/SessionController.cs +++ b/Jellyfin.Api/Controllers/SessionController.cs @@ -323,12 +323,10 @@ namespace Jellyfin.Api.Controllers [FromRoute, Required] string sessionId, [FromBody, Required] MessageCommand command) { - var nullCorrectedCommand = new MessageCommand + if (string.IsNullOrWhiteSpace(command.Header)) { - Header = string.IsNullOrWhiteSpace(command.Header) ? "Message from Server" : command.Header, - TimeoutMs = command.TimeoutMs, - Text = command.Text - }; + command.Header = "Message from Server"; + } _sessionManager.SendMessageCommand(RequestHelpers.GetSession(_sessionManager, _authContext, Request).Id, sessionId, nullCorrectedCommand, CancellationToken.None); |
