diff options
| author | Ryan Petris <ryan@petris.net> | 2020-11-15 19:55:30 -0700 |
|---|---|---|
| committer | Ryan Petris <ryan@petris.net> | 2020-11-15 19:55:30 -0700 |
| commit | 8204b25a56af7ddb20497f3d7ad8e1d8daaff7ca (patch) | |
| tree | f8da813808df73670baa4eecfc67db319783aaa1 /Jellyfin.Api/Helpers/AudioHelper.cs | |
| parent | 81d5eb4db5918debe3194236288492f26ad135bb (diff) | |
| parent | 8d1d77db94a4fcfc6d8a37b38100ce0b7267690b (diff) | |
Merge branch 'master' into fix-hdhomerun
Diffstat (limited to 'Jellyfin.Api/Helpers/AudioHelper.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/AudioHelper.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Jellyfin.Api/Helpers/AudioHelper.cs b/Jellyfin.Api/Helpers/AudioHelper.cs index a3f2d88ce..21ec2d32f 100644 --- a/Jellyfin.Api/Helpers/AudioHelper.cs +++ b/Jellyfin.Api/Helpers/AudioHelper.cs @@ -1,8 +1,10 @@ -using System.Net.Http; +using System; +using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Jellyfin.Api.Models.StreamingDtos; using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Devices; @@ -98,6 +100,11 @@ namespace Jellyfin.Api.Helpers TranscodingJobType transcodingJobType, StreamingRequestDto streamingRequest) { + if (_httpContextAccessor.HttpContext == null) + { + throw new ResourceNotFoundException(nameof(_httpContextAccessor.HttpContext)); + } + bool isHeadRequest = _httpContextAccessor.HttpContext.Request.Method == System.Net.WebRequestMethods.Http.Head; var cancellationTokenSource = new CancellationTokenSource(); |
