diff options
| author | Bond-009 <bond.009@outlook.com> | 2023-10-08 14:07:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-08 14:07:30 +0200 |
| commit | 0b31997b2f5fa3245f80711d703a4247cfbb0363 (patch) | |
| tree | 357cc2919e8eacc33a8defdb19c06f89836ea96e /Jellyfin.Api/Helpers/StreamingHelpers.cs | |
| parent | cf806ddcaade30a2a656b4974f12b9453c8d21e7 (diff) | |
| parent | b176beb88e22a36cc056439ac2a4df4fbe68f2c1 (diff) | |
Merge pull request #10348 from Bond-009/strings
Diffstat (limited to 'Jellyfin.Api/Helpers/StreamingHelpers.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/StreamingHelpers.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs index e55420d11..a653c5795 100644 --- a/Jellyfin.Api/Helpers/StreamingHelpers.cs +++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs @@ -248,7 +248,7 @@ public static class StreamingHelpers ? GetOutputFileExtension(state, mediaSource) : ("." + state.OutputContainer); - state.OutputFilePath = GetOutputFilePath(state, ext!, serverConfigurationManager, streamingRequest.DeviceId, streamingRequest.PlaySessionId); + state.OutputFilePath = GetOutputFilePath(state, ext, serverConfigurationManager, streamingRequest.DeviceId, streamingRequest.PlaySessionId); return state; } @@ -423,11 +423,11 @@ public static class StreamingHelpers /// <returns>System.String.</returns> private static string? GetOutputFileExtension(StreamState state, MediaSourceInfo? mediaSource) { - var ext = Path.GetExtension(state.RequestedUrl); + var ext = Path.GetExtension(state.RequestedUrl.AsSpan()); - if (!string.IsNullOrEmpty(ext)) + if (ext.IsEmpty) { - return ext; + return null; } // Try to infer based on the desired video codec @@ -509,7 +509,7 @@ public static class StreamingHelpers /// <param name="deviceId">The device id.</param> /// <param name="playSessionId">The play session id.</param> /// <returns>The complete file path, including the folder, for the transcoding file.</returns> - private static string GetOutputFilePath(StreamState state, string outputFileExtension, IServerConfigurationManager serverConfigurationManager, string? deviceId, string? playSessionId) + private static string GetOutputFilePath(StreamState state, string? outputFileExtension, IServerConfigurationManager serverConfigurationManager, string? deviceId, string? playSessionId) { var data = $"{state.MediaPath}-{state.UserAgent}-{deviceId!}-{playSessionId!}"; |
