disable video thumbnail edits; remove console logs

This commit is contained in:
Travis Eden 2018-11-08 14:05:06 -05:00
parent e970bb9e0d
commit 0fa9bc831e
5 changed files with 58 additions and 66 deletions

View file

@ -12,7 +12,6 @@ class PublishPreview extends React.Component {
componentDidMount () {
const { isUpdate, sourceUrl, file } = this.props;
if (isUpdate && sourceUrl) {
console.log('setting sourceUrl:', sourceUrl);
this.setState({ imgSource: sourceUrl });
} else {
this.setPreviewImageSource(file);

View file

@ -85,7 +85,9 @@ class Dropzone extends React.Component {
const { file, thumbnail, fileError, isUpdate, sourceUrl, fileExt } = this.props;
return (
<div>
{isUpdate && fileExt === 'mp4' && (<p>Video thumbnail:</p>)}
{isUpdate && fileExt === 'mp4' ? (
<p>Video updates are currently disabled. This feature will be available soon. You can edit metadata.</p>
) : (
<div className='dropzone-wrapper'>
<form>
<input
@ -142,6 +144,7 @@ class Dropzone extends React.Component {
)}
</div>
</div>
)}
</div>
);
}

View file

@ -40,10 +40,6 @@ const publish = async (publishParams, fileName, fileType) => {
fileRecord = await db.File.findOne({where: {claimId}}).then(result => result.dataValues);
}
logger.info('fileRecord:', fileRecord);
logger.info('claimRecord:', claimRecord);
logger.info('upsertCriteria:', upsertCriteria);
const [file, claim] = await Promise.all([
db.upsert(db.File, fileRecord, upsertCriteria, 'File'),
db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim'),

View file

@ -96,7 +96,6 @@ const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res)
if (claimRecord.content_type === 'video/mp4' && files.file) {
thumbnailUpdate = true;
}
logger.info('claimRecord:', claimRecord);
if (!files.file || thumbnailUpdate) {
return Promise.all([
@ -132,7 +131,6 @@ const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res)
const newThumbnailName = `${name}-${rando()}`;
const newThumbnailParams = createThumbnailPublishParams(filePath, newThumbnailName, license, nsfw);
newThumbnailParams['file_path'] = filePath;
logger.info('newThumbnailParams:', newThumbnailParams);
publish(newThumbnailParams, fileName, fileType);
publishParams['sources'] = resolution.claim.value.stream.source;

View file

@ -47,7 +47,7 @@ async function createFileRecordDataAfterPublish (fileName, fileType, publishPara
width: fileWidth,
} = await getMediaDimensions(fileType, filePath);
const obj = {
return {
name,
claimId,
outpoint: `${txid}:${nout}`,
@ -57,10 +57,6 @@ async function createFileRecordDataAfterPublish (fileName, fileType, publishPara
filePath,
fileType,
};
console.log('createFileRecordDataAfterPublish return:', obj);
return obj;
}
module.exports = {