From b816389ad4de0ddce2f3b8947a3954d4f3a9b5f7 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Fri, 21 Oct 2022 14:06:59 -0400 Subject: Get ready for backstage index --- emacsconf-publish.el | 81 ++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 41 deletions(-) (limited to 'emacsconf-publish.el') diff --git a/emacsconf-publish.el b/emacsconf-publish.el index 296c946..06baa8d 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -29,16 +29,15 @@ :type 'string :group 'emacsconf) -(defcustom emacsconf-main-extensions '(".org" ".odp" ".pdf" ".el" "--compressed56.webm" "--main.vtt" "--main_fr.vtt" "--main_ja.vtt" "--chapters.vtt" "--main--chapters.vtt") +(defcustom emacsconf-main-extensions '(".org" ".odp" ".pdf" ".el" "--compressed56.webm" "--main.vtt" "--main_fr.vtt" "--main_ja.vtt" "--chapters.vtt" "--main--chapters.vtt" "--script.fountain") "Extensions to list on public pages." :type '(repeat string) :group 'emacsconf) -(defcustom emacsconf-protected-extensions '(".en.srv2" ".srt") +(defcustom emacsconf-backstage-extensions '(".en.srv2" ".srt") "Extensions to list in the staging area." :group 'emacsconf) (defcustom emacsconf-public-media-directory nil "Can be over TRAMP" :type 'string :group 'emacsconf) -(defcustom emacsconf-protected-media-directory nil "Can be over TRAMP" :type 'string :group 'emacsconf) (defun emacsconf-update-talk (talk) "Publish the schedule page and the page for this talk." @@ -112,14 +111,15 @@ (when emacsconf-public-media-directory (emacsconf-make-public-index (expand-file-name "index.html" emacsconf-public-media-directory)) (emacsconf-generate-playlist (expand-file-name "index.m3u" emacsconf-public-media-directory) - "EmacsConf2021" + (concat emacsconf-name emacsconf-year) (emacsconf-public-talks emacsconf-info) (format "https://media.emacsconf.org/%s/" emacsconf-year))) - (when emacsconf-protected-media-directory - (emacsconf-make-protected-index (expand-file-name "index.html" emacsconf-protected-media-directory))) - (emacsconf-generate-playlist (expand-file-name "index.m3u" emacsconf-protected-media-directory) - "EmacsConf2021" (emacsconf-filter-talks emacsconf-info) - (format "https://media.emacsconf.org/%s/protected/" emacsconf-year))) + (when emacsconf-backstage-dir + (emacsconf-make-backstage-index (expand-file-name "index.html" emacsconf-backstage-dir))) + (emacsconf-generate-playlist (expand-file-name "index.m3u" emacsconf-backstage-dir) + (concat emacsconf-name emacsconf-year) + (emacsconf-filter-talks emacsconf-info) + (format "https://media.emacsconf.org/%s/backstage/" emacsconf-year))) (defun emacsconf-index-card (talk &optional extensions) "Format an HTML card for TALK, linking the files in EXTENSIONS." @@ -142,17 +142,12 @@ talk "
${video-html}${resources}${extra}${chapter-list}
")))) -(defun emacsconf-index-card-video (video-id video-file talk extensions) - (let* ((wiki-caption-dir (expand-file-name - "captions" - (expand-file-name - (plist-get talk :conf-year) - emacsconf-directory))) - (chapter-info (and video-file +(defun emacsconf-index-card-video (video-id video-file talk extensions &optional backstage) + (let* ((chapter-info (and video-file (emacsconf-make-chapter-strings (expand-file-name (concat (file-name-base video-file) "--chapters.vtt") - wiki-caption-dir) + emacsconf-cache-dir) (plist-get talk :track-base-url)))) (info (append @@ -167,7 +162,7 @@ (and video-file (let ((tracks (emacsconf-video-subtitle-tracks - (expand-file-name (concat (file-name-base video-file) ".vtt") wiki-caption-dir) + (expand-file-name (concat (file-name-base video-file) ".vtt") emacsconf-cache-dir) (or (plist-get talk :track-base-url) (plist-get talk :base-url))))) (cond @@ -210,7 +205,7 @@ :video (emacsconf-replace-plist-in-string info - (if (and video-file (file-exists-p video-file)) + (if video-file (if (eq (plist-get talk :format) 'wiki) "[[!template id=\"vid\" vidid=\"${video-id}\" src=\"${source-src}\" poster=\"${poster}\" ${captions} size=\"${video-file-size}\" duration=\"${video-duration}\" other_resources=\"\"\"${other-files}${toobnix-info}\"\"\"]] @@ -747,21 +742,21 @@ Entries are sorted chronologically, with different tracks interleaved." cancelled "\n")) "")))) -(defun emacsconf-make-protected-index (filename) - (interactive (list (expand-file-name "index.html" emacsconf-protected-media-directory))) +(defun emacsconf-make-backstage-index (filename) + (interactive (list (expand-file-name "index.html" emacsconf-backstage-dir))) (setq emacsconf-info (emacsconf-get-talk-info)) (with-temp-file filename (let* ((talks (seq-filter (lambda (o) (plist-get o :video-file)) (emacsconf-filter-talks emacsconf-info))) (received (seq-remove (lambda (o) (plist-get o :captioner)) talks)) (captioned (seq-filter (lambda (o) (plist-get o :captioner)) talks))) (insert - "" - (format "

Talks to be captioned (%d minutes)