Refactor MimeTypes.ToExtension()

Co-authored-by: Cody Robibero <cody@robibe.ro>
pull/6941/head
Ahmed Rafiq 3 years ago committed by GitHub
parent 40e05a7993
commit 0e491025ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -181,13 +181,8 @@ namespace MediaBrowser.Model.Net
return result;
}
var extensions = Model.MimeTypes.GetMimeTypeExtensions(mimeType);
if (extensions.Any())
{
return "." + extensions.First();
}
return null;
var extension = Model.MimeTypes.GetMimeTypeExtensions(mimeType).FirstOrDefault();
return string.IsNullOrEmpty(extension) ? null : "." + extension;
}
}
}

Loading…
Cancel
Save