mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Add variety of supported file formats & fix bug when parsing mime type
This commit is contained in:
parent
43c6ee929b
commit
399f670bed
@ -87,10 +87,10 @@ let RegisterPieceForm = React.createClass({
|
||||
const validFiles = files.filter(displayValidFilesFilter);
|
||||
|
||||
if(validFiles.length > 0) {
|
||||
const { type: fileType } = validFiles[0].type;
|
||||
const fileExtension = fileType && fileType.split('/').length ? fileType.split('/')[1]
|
||||
const { type: mimeType } = validFiles[0];
|
||||
const mimeSubType = mimeType && mimeType.split('/').length ? mimeType.split('/')[1]
|
||||
: 'unknown';
|
||||
const thumbnailKeyDialogExpanded = AppConstants.supportedThumbnailFileFormats.indexOf(fileExtension) === -1;
|
||||
const thumbnailKeyDialogExpanded = AppConstants.supportedThumbnailFileFormats.indexOf(mimeSubType) === -1;
|
||||
this.setState({ thumbnailKeyDialogExpanded });
|
||||
} else {
|
||||
this.setState({ thumbnailKeyDialogExpanded: false });
|
||||
|
@ -88,7 +88,14 @@ const constants = {
|
||||
|
||||
'searchThreshold': 500,
|
||||
|
||||
'supportedThumbnailFileFormats': ['png', 'jpg', 'jpeg', 'gif', 'mp4'],
|
||||
'supportedThumbnailFileFormats': [
|
||||
'x-sgi-movie', 'x-msvideo', 'quicktime', 'mpeg', 'png', 'jpeg', 'gif',
|
||||
'ogg', 'oga', 'ogv', 'ogx', 'wmv', 'wma', 'flv', '3gpp2', '3p2', '3pg',
|
||||
'png', 'jpg', 'jpeg', 'gif', '264', '3g', '3g2', '3gp', '3gp2', '3gpp',
|
||||
'mp4', 'm4a', 'm4v', 'f4v', 'f4a', 'm4b', 'm4r', 'f4b', 'mov', 'quicktime',
|
||||
'webm', 'x264', 'mpeg', 'mpeg4', 'mpg4', 'bmp', 'eps', 'jp2', 'j2k', 'jpm',
|
||||
'mj2'
|
||||
],
|
||||
|
||||
// in case of whitelabel customization, we store stuff here
|
||||
'whitelabel': {},
|
||||
|
Loading…
Reference in New Issue
Block a user