disable video thumbnail edits; remove console logs
This commit is contained in:
parent
e970bb9e0d
commit
0fa9bc831e
5 changed files with 58 additions and 66 deletions
|
@ -12,7 +12,6 @@ class PublishPreview extends React.Component {
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
const { isUpdate, sourceUrl, file } = this.props;
|
const { isUpdate, sourceUrl, file } = this.props;
|
||||||
if (isUpdate && sourceUrl) {
|
if (isUpdate && sourceUrl) {
|
||||||
console.log('setting sourceUrl:', sourceUrl);
|
|
||||||
this.setState({ imgSource: sourceUrl });
|
this.setState({ imgSource: sourceUrl });
|
||||||
} else {
|
} else {
|
||||||
this.setPreviewImageSource(file);
|
this.setPreviewImageSource(file);
|
||||||
|
|
|
@ -85,7 +85,9 @@ class Dropzone extends React.Component {
|
||||||
const { file, thumbnail, fileError, isUpdate, sourceUrl, fileExt } = this.props;
|
const { file, thumbnail, fileError, isUpdate, sourceUrl, fileExt } = this.props;
|
||||||
return (
|
return (
|
||||||
<div>
|
<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'>
|
<div className='dropzone-wrapper'>
|
||||||
<form>
|
<form>
|
||||||
<input
|
<input
|
||||||
|
@ -142,6 +144,7 @@ class Dropzone extends React.Component {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,10 +40,6 @@ const publish = async (publishParams, fileName, fileType) => {
|
||||||
fileRecord = await db.File.findOne({where: {claimId}}).then(result => result.dataValues);
|
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([
|
const [file, claim] = await Promise.all([
|
||||||
db.upsert(db.File, fileRecord, upsertCriteria, 'File'),
|
db.upsert(db.File, fileRecord, upsertCriteria, 'File'),
|
||||||
db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim'),
|
db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim'),
|
||||||
|
|
|
@ -96,7 +96,6 @@ const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res)
|
||||||
if (claimRecord.content_type === 'video/mp4' && files.file) {
|
if (claimRecord.content_type === 'video/mp4' && files.file) {
|
||||||
thumbnailUpdate = true;
|
thumbnailUpdate = true;
|
||||||
}
|
}
|
||||||
logger.info('claimRecord:', claimRecord);
|
|
||||||
|
|
||||||
if (!files.file || thumbnailUpdate) {
|
if (!files.file || thumbnailUpdate) {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
|
@ -132,7 +131,6 @@ const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res)
|
||||||
const newThumbnailName = `${name}-${rando()}`;
|
const newThumbnailName = `${name}-${rando()}`;
|
||||||
const newThumbnailParams = createThumbnailPublishParams(filePath, newThumbnailName, license, nsfw);
|
const newThumbnailParams = createThumbnailPublishParams(filePath, newThumbnailName, license, nsfw);
|
||||||
newThumbnailParams['file_path'] = filePath;
|
newThumbnailParams['file_path'] = filePath;
|
||||||
logger.info('newThumbnailParams:', newThumbnailParams);
|
|
||||||
publish(newThumbnailParams, fileName, fileType);
|
publish(newThumbnailParams, fileName, fileType);
|
||||||
|
|
||||||
publishParams['sources'] = resolution.claim.value.stream.source;
|
publishParams['sources'] = resolution.claim.value.stream.source;
|
||||||
|
|
|
@ -47,7 +47,7 @@ async function createFileRecordDataAfterPublish (fileName, fileType, publishPara
|
||||||
width: fileWidth,
|
width: fileWidth,
|
||||||
} = await getMediaDimensions(fileType, filePath);
|
} = await getMediaDimensions(fileType, filePath);
|
||||||
|
|
||||||
const obj = {
|
return {
|
||||||
name,
|
name,
|
||||||
claimId,
|
claimId,
|
||||||
outpoint: `${txid}:${nout}`,
|
outpoint: `${txid}:${nout}`,
|
||||||
|
@ -57,10 +57,6 @@ async function createFileRecordDataAfterPublish (fileName, fileType, publishPara
|
||||||
filePath,
|
filePath,
|
||||||
fileType,
|
fileType,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('createFileRecordDataAfterPublish return:', obj);
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Loading…
Reference in a new issue