Merge pull request #569 from lbryio/564-ffprobe-fails

fix: ffprobe fails
This commit is contained in:
Bill Bittner 2018-08-09 11:09:44 -07:00 committed by GitHub
commit 69cd9532d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ const claimGet = ({ ip, originalUrl, params }, res) => {
const claimId = params.claimId;
let resolveResult;
let getResult;
// resolve the claim
db.Claim.resolveClaim(name, claimId)
.then(result => {
if (!result) {
@ -28,13 +28,13 @@ const claimGet = ({ ip, originalUrl, params }, res) => {
throw new Error(`Unable to Get ${name}#${claimId}`);
}
getResult = result;
})
.then(() => {
return createFileRecordDataAfterGet(resolveResult, getResult);
})
.then(fileData => {
const upsertCriteria = { name, claimId };
return db.upsert(db.File, fileData, upsertCriteria, 'File');
if (result.completed) {
return createFileRecordDataAfterGet(resolveResult, getResult)
.then(fileData => {
const upsertCriteria = {name, claimId};
return db.upsert(db.File, fileData, upsertCriteria, 'File');
});
}
})
.then(() => {
const { message, completed } = getResult;