Handle null outputFileExtension with null-conditional operator

This commit is contained in:
Matt Lyons 2020-04-17 16:13:56 +10:00 committed by GitHub
parent b52199e9e2
commit e7fde6aaca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,12 +131,10 @@ namespace MediaBrowser.Api.Playback
/// </summary>
private string GetOutputFilePath(StreamState state, EncodingOptions encodingOptions, string outputFileExtension)
{
if (outputFileExtension == null) outputFileExtension = "";
var data = $"{state.MediaPath}-{state.UserAgent}-{state.Request.DeviceId}-{state.Request.PlaySessionId}";
var filename = data.GetMD5().ToString("N", CultureInfo.InvariantCulture);
var ext = outputFileExtension.ToLowerInvariant();
var ext = outputFileExtension?.ToLowerInvariant();
var folder = ServerConfigurationManager.GetTranscodePath();
return EnableOutputInSubFolder