commit
e21761e278
3 changed files with 23 additions and 14 deletions
|
@ -32,7 +32,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.asset-preview__label {
|
.asset-preview__label {
|
||||||
height: 100%;
|
|
||||||
padding: $thin-padding;
|
padding: $thin-padding;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -7688,9 +7688,9 @@
|
||||||
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
|
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
|
||||||
},
|
},
|
||||||
"js-yaml": {
|
"js-yaml": {
|
||||||
"version": "3.12.0",
|
"version": "3.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz",
|
||||||
"integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
|
"integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"argparse": "^1.0.7",
|
"argparse": "^1.0.7",
|
||||||
"esprima": "^4.0.0"
|
"esprima": "^4.0.0"
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
|
const logger = require('winston');
|
||||||
|
|
||||||
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
|
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
|
||||||
const db = require('../../../../models');
|
const { getFileListFileByOutpoint } = require('server/lbrynet');
|
||||||
|
|
||||||
|
const chainquery = require('chainquery').default;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
@ -10,18 +14,24 @@ const db = require('../../../../models');
|
||||||
const fileAvailability = ({ ip, originalUrl, params }, res) => {
|
const fileAvailability = ({ ip, originalUrl, params }, res) => {
|
||||||
const name = params.name;
|
const name = params.name;
|
||||||
const claimId = params.claimId;
|
const claimId = params.claimId;
|
||||||
db.File
|
logger.debug(`fileAvailability params: name:${name} claimId:${claimId}`);
|
||||||
.findOne({
|
// TODO: we probably eventually want to check the publishCache for the claimId too,
|
||||||
where: {
|
// and shop the outpoint to file_list.
|
||||||
name,
|
return chainquery.claim.queries
|
||||||
claimId,
|
.resolveClaim(name, claimId)
|
||||||
},
|
.then(result => {
|
||||||
|
return `${result.dataValues.transaction_hash_id}:${result.dataValues.vout}`;
|
||||||
|
})
|
||||||
|
.then(outpoint => {
|
||||||
|
logger.debug(`fileAvailability: outpoint: ${outpoint}`);
|
||||||
|
return getFileListFileByOutpoint(outpoint);
|
||||||
})
|
})
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (result) {
|
if (result && result[0]) {
|
||||||
return res.status(200).json({success: true, data: true});
|
return res.status(200).json({ success: true, data: true });
|
||||||
|
} else {
|
||||||
|
res.status(200).json({ success: true, data: false });
|
||||||
}
|
}
|
||||||
res.status(200).json({success: true, data: false});
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
handleErrorResponse(originalUrl, ip, error, res);
|
handleErrorResponse(originalUrl, ip, error, res);
|
||||||
|
|
Loading…
Add table
Reference in a new issue