From d3a178bda7d74a2cdc10c9091d26f2a4ce75ca37 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sun, 23 Oct 2022 08:13:31 -0400 Subject: Caption-related backstage tweaks --- emacsconf-publish.el | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'emacsconf-publish.el') diff --git a/emacsconf-publish.el b/emacsconf-publish.el index b7a6073..d254468 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -143,10 +143,11 @@ "
${video-html}${resources}${extra}${chapter-list}
")))) (defun emacsconf-index-card-video (video-id video-file talk extensions &optional backstage) - (let* ((chapter-info (and video-file + (let* ((video-base (file-name-base (replace-regexp-in-string "--\\(normalized\\|reencoded\\)" "--main" video-file))) + (chapter-info (and video-file (emacsconf-make-chapter-strings (expand-file-name - (concat (file-name-base video-file) "--chapters.vtt") + (concat video-base "--chapters.vtt") emacsconf-cache-dir) (plist-get talk :track-base-url)))) (info @@ -162,7 +163,8 @@ (and video-file (let ((tracks (emacsconf-video-subtitle-tracks - (expand-file-name (concat (file-name-base video-file) ".vtt") emacsconf-cache-dir) + (expand-file-name + (concat video-base ".vtt") emacsconf-cache-dir) (or (plist-get talk :track-base-url) (plist-get talk :base-url))))) (cond @@ -773,18 +775,18 @@ Entries are sorted chronologically, with different tracks interleaved." (if (plist-get f :caption-note) (concat "
" (plist-get f :caption-note) "
") "") :files (emacsconf-publish-talk-files f files)))) - (format "
  • %s
    %s
    %s
    View talk page
  • " + (format "
  • %s
    %s
    %s
  • " + emacsconf-base-url + (plist-get f :url) (plist-get f :title) (plist-get f :speakers) - (emacsconf-index-card f) - emacsconf-base-url - (plist-get f :url))) + (emacsconf-index-card f))) list "\n"))) (format "

    %d talk(s) being captioned (%s minutes)

    " (length (assoc-default "TO_CAPTION" by-status)) - (apply '+ (seq-map (lambda (talk) (string-to-number (plist-get talk :duration))) (assoc-default "TO_CAPTION" by-status))) + (emacsconf-sum :video-time (assoc-default "TO_CAPTION" by-status)) (mapconcat (lambda (f) (setq f (append @@ -793,22 +795,25 @@ Entries are sorted chronologically, with different tracks interleaved." (if (plist-get f :captioner) (concat "
    " (plist-get f :captioner) "
    ") "") :files (emacsconf-publish-talk-files f files)))) - (format "
  • %s
    %s
    %s
    View talk page
  • " + (format "
  • %s
    %s
    %s
  • " + emacsconf-base-url + (plist-get f :url) (plist-get f :title) (plist-get f :speakers) - (emacsconf-index-card f) - emacsconf-base-url - (plist-get f :url))) + (emacsconf-index-card f))) (assoc-default "TO_CAPTION" by-status) "\n")) (format "

    %d captioned talk(s) ready for enjoyment (%d minutes)

      %s
    " (length (assoc-default "TO_STREAM" by-status)) - (apply '+ (seq-map (lambda (talk) (string-to-number (plist-get talk :duration))) (assoc-default "TO_STREAM" by-status))) - (mapconcat (lambda (f) (format "
  • %s
    %s
    %s
  • " - (plist-get f :title) - (plist-get f :speakers) - (emacsconf-index-card f emacsconf-main-extensions))) + (emacsconf-sum :video-time (assoc-default "TO_STREAM" by-status)) + (mapconcat (lambda (f) + (format "
  • %s
    %s
    %s
  • " + emacsconf-base-url + (plist-get f :url) + (plist-get f :title) + (plist-get f :speakers) + (emacsconf-index-card (append f (list :extra (concat "Captioned by " (plist-get f :captioner)))) emacsconf-main-extensions))) (assoc-default "TO_STREAM" by-status) "\n")) (if (file-exists-p (expand-file-name "include-in-index.html" emacsconf-captions-directory)) (with-temp-buffer (insert-file-contents (expand-file-name "include-in-index.html" emacsconf-captions-directory)) (buffer-string)) -- cgit v1.2.3