fix: missing thumbnail in Amazon Link

This commit is contained in:
unishigure 2023-11-05 15:48:21 +09:00 committed by Acid Chicken (硫酸鶏)
parent 1664e9fb16
commit 60507c3a88

View File

@ -14,7 +14,7 @@ import getSensitive from "../general/sensitive";
export default function amazon(url: URL, html: HTMLRewriter) { export default function amazon(url: URL, html: HTMLRewriter) {
const card = getCard(url, html); const card = getCard(url, html);
const title = getTitle(url, html); const title = getTitle(url, html);
const image = getImage(url, html); const thumbnail = getImage(url, html);
const player = Promise.all([ const player = Promise.all([
card, card,
getPlayerUrlGeneral(url, html), getPlayerUrlGeneral(url, html),
@ -44,14 +44,14 @@ export default function amazon(url: URL, html: HTMLRewriter) {
return Promise.all([ return Promise.all([
title, title,
image, thumbnail,
player, player,
description, description,
siteName, siteName,
favicon, favicon,
sensitive, sensitive,
]).then( ]).then(
([title, image, player, description, siteName, favicon, sensitive]) => { ([title, thumbnail, player, description, siteName, favicon, sensitive]) => {
if (title === null) { if (title === null) {
return null; return null;
} }
@ -60,7 +60,7 @@ export default function amazon(url: URL, html: HTMLRewriter) {
} }
return { return {
title, title,
image, thumbnail,
description: title === description ? null : description, description: title === description ? null : description,
player, player,
allow: [], allow: [],