From 5d93c07520cad6550f7be21eba926d0a7664e7f6 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 8 Apr 2020 13:43:29 -0400 Subject: [PATCH] Revert "fixes" This reverts commit 9187d0d71d80fc61e4be3aa4e34cc856edc98e80. --- lbrytv/src/chainquery.js | 2 +- lbrytv/src/html.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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`;