From ba26b3fde79e4329056794cb5e8f9c1a1a76787d Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Fri, 8 Nov 2024 19:02:59 -0500 Subject: use --main.vtt or --reencoded.vtt backstage --- emacsconf-publish.el | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/emacsconf-publish.el b/emacsconf-publish.el index b29266c..11924e8 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -369,9 +369,8 @@ (let ((tracks (emacsconf-video-subtitle-tracks (or (plist-get talk :caption-file) - (concat (replace-regexp-in-string "reencoded\\|original" "main" - video-base) - ".vtt")) + (emacsconf-talk-file talk "--main.vtt") + (emacsconf-talk-file talk "--reencoded.vtt")) (or (plist-get talk :track-base-url) (plist-get talk :base-url)) (plist-get talk :files)))) @@ -1752,22 +1751,24 @@ ${include} (defun emacsconf-video-subtitle-tracks (filename track-base-url &optional files) (setq files (or files (directory-files emacsconf-cache-dir))) - (concat - (if (member (file-name-nondirectory filename) files) - (format "" - (concat (or track-base-url "") (file-name-nondirectory filename))) - "") - (mapconcat - (lambda (lang) - (let ((lang-file (concat (file-name-sans-extension filename) "_" (car lang) "." (file-name-extension filename)))) - (if (member lang-file files) - (format "" - (cdr lang) - (car lang) - (concat (or track-base-url "") (file-name-nondirectory lang-file))) - ""))) - emacsconf-publish-subtitle-languages - ""))) + (if filename + (concat + (if (member (file-name-nondirectory filename) files) + (format "" + (concat (or track-base-url "") (file-name-nondirectory filename))) + "") + (mapconcat + (lambda (lang) + (let ((lang-file (concat (file-name-sans-extension filename) "_" (car lang) "." (file-name-extension filename)))) + (if (member lang-file files) + (format "" + (cdr lang) + (car lang) + (concat (or track-base-url "") (file-name-nondirectory lang-file))) + ""))) + emacsconf-publish-subtitle-languages + "")) + "")) (defun emacsconf-publish-link-file-formats (file-prefix) (string-join (emacsconf-publish-link-file-formats-as-list file-prefix) " ")) -- cgit v1.2.3