From d8881dbc1333a68644b5d9808a7471ba9ab25194 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 10 Oct 2023 10:14:48 -0400 Subject: rename VIDEO_SLUG to FILE_PREFIX --- emacsconf-publish.el | 92 ++++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'emacsconf-publish.el') diff --git a/emacsconf-publish.el b/emacsconf-publish.el index 4fac960..485dd84 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -135,9 +135,9 @@ (defun emacsconf-index-card (talk &optional extensions) "Format an HTML card for TALK, linking the files in EXTENSIONS." - (let* ((video-slug (plist-get talk :video-slug)) + (let* ((file-prefix (plist-get talk :file-prefix)) (video-file (plist-get talk :video-file)) - (video (and video-slug + (video (and file-prefix (emacsconf-index-card-video (or (plist-get talk :video-id) (concat (plist-get talk :slug) "-mainVideo")) @@ -564,9 +564,9 @@ ${pad-info}${irc-info}${status-info}${schedule-info}\n" (let ((default-directory emacsconf-directory)) (mapc (lambda (ext) - (let ((filename (expand-file-name (concat (plist-get talk :video-slug) ext) + (let ((filename (expand-file-name (concat (plist-get talk :file-prefix) ext) (expand-file-name "captions" (expand-file-name emacsconf-year emacsconf-directory)))) - (cached-file (expand-file-name (concat (plist-get talk :video-slug) ext) emacsconf-cache-dir))) + (cached-file (expand-file-name (concat (plist-get talk :file-prefix) ext) emacsconf-cache-dir))) (when (and (file-exists-p cached-file) (or (not (file-exists-p filename)) @@ -1086,7 +1086,7 @@ Entries are sorted chronologically, with different tracks interleaved." (defun emacsconf-publish-talk-files (talk files) (seq-filter (lambda (o) - (and (string-match (concat "^" (regexp-quote (plist-get talk :video-slug))) o) + (and (string-match (concat "^" (regexp-quote (plist-get talk :file-prefix))) o) (not (string= (plist-get talk :video-file) o)))) files)) @@ -1134,7 +1134,7 @@ Entries are sorted chronologically, with different tracks interleaved." (defun emacsconf-publish-backstage-to-assign (by-status files) (let ((list (assoc-default "TO_ASSIGN" by-status))) - (format "

%s talk(s) to be captioned (%d minutes)

You can e-mail sacha@sachachua.com to call dibs on editing the captions for one of these talks. This year, we're experimenting with using OpenAI Whisper to provide auto-generated VTT that you can use as a starting point. If you're writing them from scratch, you can choose to include timing information, or we can probably figure them out afterwards with a forced alignment tool. More info: Editing captions, captioning tips

" + (format "

%s talk(s) to be captioned (%d minutes)

You can e-mail sacha@sachachua.com to call dibs on editing the captions for one of these talks. We use OpenAI Whisper to provide auto-generated VTT that you can use as a starting point, but you can also write the captions from scratch if you like. If you're writing them from scratch, you can choose to include timing information, or we can probably figure them out afterwards with a forced alignment tool. More info: captioning tips

" (length list) (emacsconf-sum :video-time list) (mapconcat @@ -1285,14 +1285,14 @@ answers without needing to listen to everything again. You can see No Q&A video for this talk") :video-file (cond - ((file-exists-p (expand-file-name (concat (plist-get f :video-slug) "--answers.webm") emacsconf-cache-dir)) - (concat (plist-get f :video-slug) "--answers.webm")) - ((file-exists-p (expand-file-name (concat (plist-get f :video-slug) "--bbb-webcams.webm") emacsconf-cache-dir)) - (concat (plist-get f :video-slug) "--bbb-webcams.webm")) + ((file-exists-p (expand-file-name (concat (plist-get f :file-prefix) "--answers.webm") emacsconf-cache-dir)) + (concat (plist-get f :file-prefix) "--answers.webm")) + ((file-exists-p (expand-file-name (concat (plist-get f :file-prefix) "--bbb-webcams.webm") emacsconf-cache-dir)) + (concat (plist-get f :file-prefix) "--bbb-webcams.webm")) (t t)) ;; omit video :video-id "-qanda" :extra @@ -1304,20 +1304,20 @@ answers without needing to listen to everything again. You can see Etherpad (Markdown)" "") (emacsconf-surround ", BBB playback" "") (emacsconf-surround ", BBB text chat" "") (emacsconf-surround ", BBB audio only" "")) :files (emacsconf-publish-talk-files f files)) f) @@ -1331,10 +1331,10 @@ answers without needing to listen to everything again. You can see "))))) (defun emacsconf-publish-filter-files (talk files extensions &optional selector) - (when (plist-get talk :video-slug) + (when (plist-get talk :file-prefix) (seq-filter (lambda (f) - (string-match (concat (regexp-quote (plist-get talk :video-slug)) + (string-match (concat (regexp-quote (plist-get talk :file-prefix)) (if selector (concat "--" selector)) ".*" (regexp-opt extensions) @@ -1499,8 +1499,8 @@ answers without needing to listen to everything again. You can see Download %s" (or (plist-get talk :base-url) "") file - (replace-regexp-in-string (concat "^" (regexp-quote (plist-get talk :video-slug))) "" file))) + (replace-regexp-in-string (concat "^" (regexp-quote (plist-get talk :file-prefix))) "" file))) (plist-get talk :files)) - (let ((video-slug (plist-get talk :video-slug))) + (let ((file-prefix (plist-get talk :file-prefix))) (delq nil (seq-map (lambda (ext) (let ((file (expand-file-name - (concat video-slug ext) + (concat file-prefix ext) emacsconf-cache-dir)) size) (when (file-exists-p file) @@ -1524,7 +1524,7 @@ answers without needing to listen to everything again. You can see Download %s%s" (or (plist-get talk :base-url) "") - (concat video-slug ext) + (concat file-prefix ext) ext size)))) extensions))))) @@ -1543,10 +1543,10 @@ answers without needing to listen to everything again. You can see (length (org-entry-get (point) "VIDEO_SLUG")) 80) - (copy-file (expand-file-name (concat (org-entry-get (point) "VIDEO_SLUG") "--main.webm") emacsconf-cache-dir) + (when (> (length (org-entry-get (point) "FILE_PREFIX")) 80) + (copy-file (expand-file-name (concat (org-entry-get (point) "FILE_PREFIX") "--main.webm") emacsconf-cache-dir) (expand-file-name (concat "emacsconf-" emacsconf-year "-" (org-entry-get (point) "SLUG") ".webm") emacsconf-cache-dir) t)) (browse-url "https://toobnix.org/videos/upload#upload")))) (defun emacsconf-publish-files () (interactive) - (let* ((slug (org-entry-get (point) "VIDEO_SLUG")) + (let* ((slug (org-entry-get (point) "FILE_PREFIX")) (video-file (emacsconf-get-preferred-video slug)) (wiki-captions-directory (expand-file-name "captions" (expand-file-name emacsconf-year emacsconf-directory)))) (org-entry-put (point) "PUBLIC" "1") @@ -2224,7 +2224,7 @@ There is no live Q&A room for ${title}. You can find more information about the ;; Copy main extension files from backstage to public (let ((files (directory-files emacsconf-backstage-dir nil (concat "^" - (regexp-quote (plist-get talk :video-slug)) + (regexp-quote (plist-get talk :file-prefix)) (regexp-opt emacsconf-main-extensions))))) (mapc (lambda (file) (when (or (not (string-match "--main.vtt$" file)) @@ -2235,7 +2235,7 @@ There is no live Q&A room for ${title}. You can find more information about the ;; Remove files from public (let ((files (directory-files emacsconf-public-media-directory nil (concat "^" - (regexp-quote (plist-get talk :video-slug) + (regexp-quote (plist-get talk :file-prefix) ))))) (mapc (lambda (file) (delete-file (expand-file-name file emacsconf-public-media-directory))) @@ -2265,7 +2265,7 @@ There is no live Q&A room for ${title}. You can find more information about the (emacsconf-replace-plist-in-string (append (list :conf-name emacsconf-name :year emacsconf-year :chapters - (let ((chapters (subed-parse-file (expand-file-name (concat (plist-get talk :video-slug) "--main--chapters.vtt") emacsconf-cache-dir)))) + (let ((chapters (subed-parse-file (expand-file-name (concat (plist-get talk :file-prefix) "--main--chapters.vtt") emacsconf-cache-dir)))) (if chapters (concat (mapconcat (lambda (chapter) -- cgit v1.2.3