aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/StreamingHelpers.cs
diff options
context:
space:
mode:
authorRyan Petris <ryan@petris.net>2020-11-15 19:55:30 -0700
committerRyan Petris <ryan@petris.net>2020-11-15 19:55:30 -0700
commit8204b25a56af7ddb20497f3d7ad8e1d8daaff7ca (patch)
treef8da813808df73670baa4eecfc67db319783aaa1 /Jellyfin.Api/Helpers/StreamingHelpers.cs
parent81d5eb4db5918debe3194236288492f26ad135bb (diff)
parent8d1d77db94a4fcfc6d8a37b38100ce0b7267690b (diff)
Merge branch 'master' into fix-hdhomerun
Diffstat (limited to 'Jellyfin.Api/Helpers/StreamingHelpers.cs')
-rw-r--r--Jellyfin.Api/Helpers/StreamingHelpers.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs
index 89ab2da62..0566f4c4d 100644
--- a/Jellyfin.Api/Helpers/StreamingHelpers.cs
+++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs
@@ -83,8 +83,12 @@ namespace Jellyfin.Api.Helpers
}
streamingRequest.StreamOptions = ParseStreamOptions(httpRequest.Query);
+ if (httpRequest.Path.Value == null)
+ {
+ throw new ResourceNotFoundException(nameof(httpRequest.Path));
+ }
- var url = httpRequest.Path.Value.Split('.').Last();
+ var url = httpRequest.Path.Value.Split('.')[^1];
if (string.IsNullOrEmpty(streamingRequest.AudioCodec))
{
@@ -169,7 +173,7 @@ namespace Jellyfin.Api.Helpers
string? containerInternal = Path.GetExtension(state.RequestedUrl);
- if (string.IsNullOrEmpty(streamingRequest.Container))
+ if (!string.IsNullOrEmpty(streamingRequest.Container))
{
containerInternal = streamingRequest.Container;
}