diff options
Diffstat (limited to 'Emby.Server.Implementations/Session')
| -rw-r--r-- | Emby.Server.Implementations/Session/HttpSessionController.cs | 9 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Session/SessionManager.cs | 12 |
2 files changed, 12 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/Session/HttpSessionController.cs b/Emby.Server.Implementations/Session/HttpSessionController.cs index bd53da1bd..940c821e2 100644 --- a/Emby.Server.Implementations/Session/HttpSessionController.cs +++ b/Emby.Server.Implementations/Session/HttpSessionController.cs @@ -66,19 +66,22 @@ namespace Emby.Server.Implementations.Session return SendMessage(name, new Dictionary<string, string>(), cancellationToken); } - private Task SendMessage(string name, + private async Task SendMessage(string name, Dictionary<string, string> args, CancellationToken cancellationToken) { var url = PostUrl + "/" + name + ToQueryString(args); - return _httpClient.Post(new HttpRequestOptions + using ((await _httpClient.Post(new HttpRequestOptions { Url = url, CancellationToken = cancellationToken, BufferContent = false - }); + }).ConfigureAwait(false))) + { + + } } public Task SendSessionEndedNotification(SessionInfoDto sessionInfo, CancellationToken cancellationToken) diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index 97506cdef..2c1535165 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -437,7 +437,7 @@ namespace Emby.Server.Implementations.Session if (!string.IsNullOrEmpty(deviceId)) { var userIdString = userId.HasValue ? userId.Value.ToString("N") : null; - device = await _deviceManager.RegisterDevice(deviceId, deviceName, appName, appVersion, userIdString).ConfigureAwait(false); + device = _deviceManager.RegisterDevice(deviceId, deviceName, appName, appVersion, userIdString); } } @@ -446,7 +446,7 @@ namespace Emby.Server.Implementations.Session if (device == null) { var userIdString = userId.HasValue ? userId.Value.ToString("N") : null; - device = await _deviceManager.RegisterDevice(deviceId, deviceName, appName, appVersion, userIdString).ConfigureAwait(false); + device = _deviceManager.RegisterDevice(deviceId, deviceName, appName, appVersion, userIdString); } if (device != null) @@ -1567,7 +1567,7 @@ namespace Emby.Server.Implementations.Session ReportCapabilities(session, capabilities, true); } - private async void ReportCapabilities(SessionInfo session, + private void ReportCapabilities(SessionInfo session, ClientCapabilities capabilities, bool saveCapabilities) { @@ -1593,7 +1593,7 @@ namespace Emby.Server.Implementations.Session { try { - await SaveCapabilities(session.DeviceId, capabilities).ConfigureAwait(false); + SaveCapabilities(session.DeviceId, capabilities); } catch (Exception ex) { @@ -1607,9 +1607,9 @@ namespace Emby.Server.Implementations.Session return _deviceManager.GetCapabilities(deviceId); } - private Task SaveCapabilities(string deviceId, ClientCapabilities capabilities) + private void SaveCapabilities(string deviceId, ClientCapabilities capabilities) { - return _deviceManager.SaveCapabilities(deviceId, capabilities); + _deviceManager.SaveCapabilities(deviceId, capabilities); } public SessionInfoDto GetSessionInfoDto(SessionInfo session) |
