diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-02-02 19:04:10 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-02 19:04:10 -0500 |
| commit | 32f393d57fd634ed9771078b5fbf87d4466a927c (patch) | |
| tree | 522825aab3eb32cf3707d158463d26959d76a6a9 /MediaBrowser.Api/UserLibrary/PlaystateService.cs | |
| parent | 42d5a48491904ae4251e32c17da037a1a5ba77eb (diff) | |
| parent | 1cdcace0618658d1e99e98c3f539baf3ae72ab14 (diff) | |
Merge pull request #764 from Bond-009/encoding
Remove dead code, made some functions properly async
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/PlaystateService.cs')
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/PlaystateService.cs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/MediaBrowser.Api/UserLibrary/PlaystateService.cs b/MediaBrowser.Api/UserLibrary/PlaystateService.cs index a133bc8e9..b40a92a7c 100644 --- a/MediaBrowser.Api/UserLibrary/PlaystateService.cs +++ b/MediaBrowser.Api/UserLibrary/PlaystateService.cs @@ -366,9 +366,9 @@ namespace MediaBrowser.Api.UserLibrary /// Posts the specified request. /// </summary> /// <param name="request">The request.</param> - public void Delete(OnPlaybackStopped request) + public Task Delete(OnPlaybackStopped request) { - Post(new ReportPlaybackStopped + return Post(new ReportPlaybackStopped { ItemId = new Guid(request.Id), PositionTicks = request.PositionTicks, @@ -379,20 +379,18 @@ namespace MediaBrowser.Api.UserLibrary }); } - public void Post(ReportPlaybackStopped request) + public async Task Post(ReportPlaybackStopped request) { Logger.LogDebug("ReportPlaybackStopped PlaySessionId: {0}", request.PlaySessionId ?? string.Empty); if (!string.IsNullOrWhiteSpace(request.PlaySessionId)) { - ApiEntryPoint.Instance.KillTranscodingJobs(_authContext.GetAuthorizationInfo(Request).DeviceId, request.PlaySessionId, s => true); + await ApiEntryPoint.Instance.KillTranscodingJobs(_authContext.GetAuthorizationInfo(Request).DeviceId, request.PlaySessionId, s => true); } request.SessionId = GetSession(_sessionContext).Id; - var task = _sessionManager.OnPlaybackStopped(request); - - Task.WaitAll(task); + await _sessionManager.OnPlaybackStopped(request); } /// <summary> |
