From 180da2421f15e48dc30621d0840e89d70385b52f Mon Sep 17 00:00:00 2001 From: hanyd Date: Sat, 28 Dec 2024 23:51:57 +0800 Subject: [PATCH] Redo change render order --- src/thumbnail-utils/thumbnails.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/thumbnail-utils/thumbnails.ts b/src/thumbnail-utils/thumbnails.ts index 19cbb5f0..8e64ef89 100644 --- a/src/thumbnail-utils/thumbnails.ts +++ b/src/thumbnail-utils/thumbnails.ts @@ -31,12 +31,6 @@ export async function labelThumbnail( } const [videoID] = videoIDs; - const category = await getVideoLabel(videoID); - if (!category) { - hideThumbnailLabel(thumbnail); - return null; - } - // 获取或创建缩略图标签 const { overlay, text } = await createOrGetThumbnail(thumbnail); @@ -47,6 +41,12 @@ export async function labelThumbnail( } } + const category = await getVideoLabel(videoID); + if (!category) { + hideThumbnailLabel(thumbnail); + return null; + } + overlay.style.setProperty( "--category-color", `var(--sb-category-preview-${category}, var(--sb-category-${category}))`