diff options
| author | Bond-009 <bond.009@outlook.com> | 2024-02-14 11:24:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-14 11:24:35 +0100 |
| commit | 0bf1c10c443c4763143e37fa9dce269c4e5cbad9 (patch) | |
| tree | 8fb4346d64399d4eb3ca502ddda7e53e0161b106 /Jellyfin.Api/Helpers/StreamingHelpers.cs | |
| parent | c7d986fb430550deef8d7a2722763bb784ebaea8 (diff) | |
| parent | 9230472056ea92a54a3f47bcb10142310ae0200e (diff) | |
Merge pull request #10990 from Shadowghost/bdmv-fixes
BDMV fixes
Diffstat (limited to 'Jellyfin.Api/Helpers/StreamingHelpers.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/StreamingHelpers.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs index 7a3842a9f..bfe71fd87 100644 --- a/Jellyfin.Api/Helpers/StreamingHelpers.cs +++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs @@ -225,7 +225,7 @@ public static class StreamingHelpers var ext = string.IsNullOrWhiteSpace(state.OutputContainer) ? GetOutputFileExtension(state, mediaSource) - : ("." + state.OutputContainer); + : ("." + GetContainerFileExtension(state.OutputContainer)); state.OutputFilePath = GetOutputFilePath(state, ext, serverConfigurationManager, streamingRequest.DeviceId, streamingRequest.PlaySessionId); @@ -559,4 +559,23 @@ public static class StreamingHelpers } } } + + /// <summary> + /// Parses the container into its file extension. + /// </summary> + /// <param name="container">The container.</param> + private static string? GetContainerFileExtension(string? container) + { + if (string.Equals(container, "mpegts", StringComparison.OrdinalIgnoreCase)) + { + return "ts"; + } + + if (string.Equals(container, "matroska", StringComparison.OrdinalIgnoreCase)) + { + return "mkv"; + } + + return container; + } } |
