tagliatelle

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 7d54c4d161fc51d10ecbf670e8ff64c6a3c9cfce
parent 5742d5c174c69b803f2007449a2c281f95eb76b4
Author: breadcat <breadcat@users.noreply.github.com>
Date:   Sun, 17 May 2026 18:56:16 +0100

Support video thumbnails in bulk tag editor

Diffstat:
Mstatic/bulk-tag.js | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/static/bulk-tag.js b/static/bulk-tag.js @@ -117,6 +117,7 @@ document.addEventListener('DOMContentLoaded', function () { // Hover previews for recent images const IMAGE_EXTENSIONS = /\.(jpe?g|png|gif|webp)$/i; + const VIDEO_EXTENSIONS = /\.(mp4|webm|m4v)$/i; const tooltip = document.createElement('div'); tooltip.id = 'thumb-tooltip'; @@ -140,9 +141,13 @@ document.addEventListener('DOMContentLoaded', function () { document.querySelectorAll('.file-item a').forEach(function (link) { const filename = link.title || link.textContent.trim(); - if (!IMAGE_EXTENSIONS.test(filename)) return; + const isImage = IMAGE_EXTENSIONS.test(filename); + const isVideo = VIDEO_EXTENSIONS.test(filename); + if (!isImage && !isVideo) return; - const thumbUrl = '/uploads/' + filename; + const thumbUrl = isVideo + ? '/uploads/thumbnails/' + filename + '.jpg' + : '/uploads/' + filename; link.addEventListener('mouseenter', function () { tooltipImg.src = thumbUrl;