diff options
| author | cvium <clausvium@gmail.com> | 2021-09-10 11:54:26 +0200 |
|---|---|---|
| committer | cvium <clausvium@gmail.com> | 2021-09-10 11:54:26 +0200 |
| commit | 026a7af0e8cc15f889ba94079c8bc9566a74d505 (patch) | |
| tree | b2044214de9b5bdd929b264fc4975c65d639254d /Jellyfin.Api/Helpers/AudioHelper.cs | |
| parent | 1a5a74d2a95506249cf071c659e3c6cf01f28f78 (diff) | |
Don't throw when livestream file isn't found
Diffstat (limited to 'Jellyfin.Api/Helpers/AudioHelper.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/AudioHelper.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Jellyfin.Api/Helpers/AudioHelper.cs b/Jellyfin.Api/Helpers/AudioHelper.cs index 06f889f08..e50355129 100644 --- a/Jellyfin.Api/Helpers/AudioHelper.cs +++ b/Jellyfin.Api/Helpers/AudioHelper.cs @@ -1,4 +1,5 @@ -using System.Net.Http; +using System.IO; +using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Jellyfin.Api.Models.StreamingDtos; @@ -121,6 +122,10 @@ namespace Jellyfin.Api.Helpers StreamingHelpers.AddDlnaHeaders(state, _httpContextAccessor.HttpContext.Response.Headers, true, streamingRequest.StartTimeTicks, _httpContextAccessor.HttpContext.Request, _dlnaManager); var liveStreamInfo = _mediaSourceManager.GetLiveStreamInfo(streamingRequest.LiveStreamId); + if (liveStreamInfo == null) + { + throw new FileNotFoundException(); + } var liveStream = new ProgressiveFileStream(liveStreamInfo.GetStream()); // TODO (moved from MediaBrowser.Api): Don't hardcode contentType return new FileStreamResult(liveStream, MimeTypes.GetMimeType("file.ts")); |
