fall back on contentType for extension on file view (#7704)

This commit is contained in:
jessopb 2022-10-20 14:17:43 -04:00 committed by GitHub
parent ce692d38ea
commit 09baf1d9b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ const Lbry = {
// Returns a human readable media type based on the content type or extension of a file that is returned by the sdk
getMediaType: (contentType: ?string, fileName: ?string) => {
if (fileName) {
if (fileName && fileName.split('.').length > 1) {
const formats = [
[/\.(mp4|m4v|webm|flv|f4v|ogv)$/i, 'video'],
[/\.(mp3|m4a|aac|wav|flac|ogg|opus)$/i, 'audio'],