update build

This commit is contained in:
Sean Yesmunt 2018-07-09 00:56:32 -04:00
parent 189b11ac50
commit 341db02c09

16
dist/bundle.js vendored
View file

@ -2075,12 +2075,9 @@ Lbry.connect = function () {
return Lbry.connectPromise; return Lbry.connectPromise;
}; };
Lbry.getMediaType = function (contentType, fileName) { Lbry.getMediaType = function (contentType, extname) {
if (contentType) { if (extname) {
return (/^[^/]+/.exec(contentType)[0] var formats = [[/^(mp4|m4v|webm|flv|f4v|ogv)$/i, 'video'], [/^(mp3|m4a|aac|wav|flac|ogg|opus)$/i, 'audio'], [/^(html|htm|xml|pdf|odf|doc|docx|md|markdown|txt|epub|org)$/i, 'document'], [/^(stl|obj|fbx|gcode)$/i, '3D-file']];
);
} else if (fileName) {
var formats = [[/^.+\.(mp4|m4v|webm|flv|f4v|ogv)$/i, 'video'], [/^.+\.(mp3|m4a|aac|wav|flac|ogg|opus)$/i, 'audio'], [/^.+\.(html|htm|xml|pdf|odf|doc|docx|md|markdown|txt|epub|org)$/i, 'document'], [/^.+\.(stl|obj|fbx|gcode)$/i, '3D-file']];
var res = formats.reduce(function (ret, testpair) { var res = formats.reduce(function (ret, testpair) {
switch (testpair[0].test(ret)) { switch (testpair[0].test(ret)) {
case true: case true:
@ -2088,8 +2085,11 @@ Lbry.getMediaType = function (contentType, fileName) {
default: default:
return ret; return ret;
} }
}, fileName); }, extname);
return res === fileName ? 'unknown' : res; return res === extname ? 'unknown' : res;
} else if (contentType) {
return (/^[^/]+/.exec(contentType)[0]
);
} }
return 'unknown'; return 'unknown';
}; };