From 383c8612a7dff18fbae3b7fa04e6fa631e45fed3 Mon Sep 17 00:00:00 2001 From: ashley Date: Wed, 20 Aug 2025 16:58:36 +0200 Subject: [PATCH] Update html/search.ejs --- html/search.ejs | 69 ++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 38 deletions(-) diff --git a/html/search.ejs b/html/search.ejs index 01c60d97..f7b3f603 100644 --- a/html/search.ejs +++ b/html/search.ejs @@ -1423,28 +1423,25 @@ font-weight: 1000;" href="/watch?v=<%= x.videoId %>" class="title max-lines-2">< <%= x.author %><% if (x?.authorVerified) { %> <% } %> - +
- <% if (x?.hasCaptions) { %> - Subtitles - <% } %> - <% if (x?.isNew) { %> - New - <% } %> - <% if (x?.is4k) { %> - 4K Ultra-HD - <% } %> - <% if (x?.is8k) { %> - 8K - <% } %> - <% if (x?.isVr360) { %> - VR 360° - <% } %> - <% if (x?.isVr180) { %> - VR 180° - <% } %> + <% + const badgeConfig = [ + { show: x?.hasCaptions, label: "Subtitles" }, + { show: x?.isNew, label: "New" }, + { show: x?.is4k, label: "4K Ultra-HD" }, + { show: x?.is8k, label: "8K" }, + { show: x?.isVr360, label: "VR 360°" }, + { show: x?.isVr180, label: "VR 180°" }, + ]; + + badgeConfig.forEach(b => { + if (b.show) { %> + <%= b.label %> + <% } }) %>
+
@@ -1483,27 +1480,23 @@ font-weight: 1000;" href="/watch?v=<%= x.videoId %>" class="title max-lines-2">< <%= x.author %><% if (x?.authorVerified) { %> <% } %>
-
- <% if (x?.hasCaptions) { %> - Subtitles - <% } %> - <% if (x?.isNew) { %> - New - <% } %> - <% if (x?.is4k) { %> - 4K Ultra-HD - <% } %> - <% if (x?.is8k) { %> - 8K - <% } %> - <% if (x?.isVr360) { %> - VR 360° - <% } %> - <% if (x?.isVr180) { %> - VR 180° - <% } %> + <% + const badgeConfig = [ + { show: x?.hasCaptions, label: "Subtitles" }, + { show: x?.isNew, label: "New" }, + { show: x?.is4k, label: "4K Ultra-HD" }, + { show: x?.is8k, label: "8K" }, + { show: x?.isVr360, label: "VR 360°" }, + { show: x?.isVr180, label: "VR 180°" }, + ]; + + badgeConfig.forEach(b => { + if (b.show) { %> + <%= b.label %> + <% } }) %>
+