diff --git a/lbrytv/src/chainquery.js b/lbrytv/src/chainquery.js index 7855c97d1..a7532c579 100644 --- a/lbrytv/src/chainquery.js +++ b/lbrytv/src/chainquery.js @@ -24,7 +24,7 @@ module.exports.getClaim = async function getClaim(claimName, claimId, channelNam let params = [claimName]; 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 ' + 'LEFT JOIN claim channel_claim on claim.publisher_id = channel_claim.claim_id ' + 'WHERE claim.name = ?'; diff --git a/lbrytv/src/html.js b/lbrytv/src/html.js index 2d88f4aac..76987d19d 100644 --- a/lbrytv/src/html.js +++ b/lbrytv/src/html.js @@ -63,10 +63,11 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}) { ? escapeHtmlProperty(truncateDescription(claim.description)) : `View ${claimTitle} on lbry.tv`; 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; - if (Number(claim.fee) <= 0 && claim.source_media_type.startsWith('image/')) { + if (claim && isImage && isFree) { imageThumbnail = generateStreamUrl(claimName, claim.claim_id); } const claimThumbnail = escapeHtmlProperty(claim.thumbnail_url) || imageThumbnail || `${URL}/v1-og.png`;