From fd25b5f2968385741e36b5a6624a80d7ef14b61f Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 12 Nov 2023 15:33:34 -0500 Subject: [PATCH] fix(dearrow): support DeArrow thumbnail submissions at 0 seconds (#1979) --- src/plugins/dearrow/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/dearrow/index.tsx b/src/plugins/dearrow/index.tsx index f6b9ef95..52cf1d53 100644 --- a/src/plugins/dearrow/index.tsx +++ b/src/plugins/dearrow/index.tsx @@ -50,7 +50,7 @@ async function embedDidMount(this: Component) { const { titles, thumbnails } = await res.json(); const hasTitle = titles[0]?.votes >= 0; - const hasThumb = thumbnails[0]?.votes >= 0; + const hasThumb = thumbnails[0]?.votes >= 0 && !thumbnails[0].original; if (!hasTitle && !hasThumb) return; @@ -58,12 +58,12 @@ async function embedDidMount(this: Component) { enabled: true }; - if (titles[0]?.votes >= 0) { + if (hasTitle) { embed.dearrow.oldTitle = embed.rawTitle; embed.rawTitle = titles[0].title; } - if (thumbnails[0]?.votes >= 0 && thumbnails[0].timestamp) { + if (hasThumb) { embed.dearrow.oldThumb = embed.thumbnail.proxyURL; embed.thumbnail.proxyURL = `https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${videoId}&time=${thumbnails[0].timestamp}`; }