parent
7401a590cc
commit
5d93c07520
2 changed files with 4 additions and 3 deletions
|
@ -24,7 +24,7 @@ module.exports.getClaim = async function getClaim(claimName, claimId, channelNam
|
||||||
let params = [claimName];
|
let params = [claimName];
|
||||||
|
|
||||||
let sql =
|
let sql =
|
||||||
'SELECT channel_claim.name as channel, claim.claim_id, claim.name, claim.description, claim.language, claim.thumbnail_url, claim.title, claim.source_media_type, claim.frame_width, claim.frame_height, claim.fee ' +
|
'SELECT channel_claim.name as channel, claim.claim_id, claim.name, claim.description, claim.language, claim.thumbnail_url, claim.title, claim.source_media_type, claim.frame_width, claim.frame_height ' +
|
||||||
'FROM claim ' +
|
'FROM claim ' +
|
||||||
'LEFT JOIN claim channel_claim on claim.publisher_id = channel_claim.claim_id ' +
|
'LEFT JOIN claim channel_claim on claim.publisher_id = channel_claim.claim_id ' +
|
||||||
'WHERE claim.name = ?';
|
'WHERE claim.name = ?';
|
||||||
|
|
|
@ -63,10 +63,11 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}) {
|
||||||
? escapeHtmlProperty(truncateDescription(claim.description))
|
? escapeHtmlProperty(truncateDescription(claim.description))
|
||||||
: `View ${claimTitle} on lbry.tv`;
|
: `View ${claimTitle} on lbry.tv`;
|
||||||
const claimLanguage = escapeHtmlProperty(claim.language) || 'en_US';
|
const claimLanguage = escapeHtmlProperty(claim.language) || 'en_US';
|
||||||
|
const isImage = claim && claim.value && claim.value.stream_type === 'image';
|
||||||
|
const isFree = claim && claim.value && (!claim.value.fee || Number(claim.value.fee.amount) <= 0);
|
||||||
let imageThumbnail;
|
let imageThumbnail;
|
||||||
|
|
||||||
if (Number(claim.fee) <= 0 && claim.source_media_type.startsWith('image/')) {
|
if (claim && isImage && isFree) {
|
||||||
imageThumbnail = generateStreamUrl(claimName, claim.claim_id);
|
imageThumbnail = generateStreamUrl(claimName, claim.claim_id);
|
||||||
}
|
}
|
||||||
const claimThumbnail = escapeHtmlProperty(claim.thumbnail_url) || imageThumbnail || `${URL}/v1-og.png`;
|
const claimThumbnail = escapeHtmlProperty(claim.thumbnail_url) || imageThumbnail || `${URL}/v1-og.png`;
|
||||||
|
|
Loading…
Reference in a new issue