From 934b8c909ab00b2a55501f8bdd2a6bc1ac017d60 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Thu, 24 Nov 2022 14:08:05 -0500 Subject: publishing without unedited captions --- emacsconf-publish.el | 145 ++++++++++++++++++++++++++------------------------ emacsconf-schedule.el | 28 ++++++---- emacsconf.el | 15 ++++-- 3 files changed, 103 insertions(+), 85 deletions(-) diff --git a/emacsconf-publish.el b/emacsconf-publish.el index b2c82b3..968a3f2 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -449,7 +449,10 @@ resources." o)) (concat (if (plist-get o :qa-public) "# Talk\n\n" "") - (emacsconf-index-card o emacsconf-main-extensions) + (emacsconf-index-card o + (if (plist-get o :captions-edited) + emacsconf-main-extensions + (remove "--main.vtt" emacsconf-main-extensions))) (if (plist-get o :qa-public) (concat "\n\n# Q&A\n\n" (emacsconf-index-card (append @@ -479,8 +482,9 @@ resources." (emacsconf-replace-plist-in-string (append o (list :format - (concat (or (plist-get o :video-duration) - (concat (plist-get o :duration) "-min talk")) + (concat (or (plist-get o :video-time) + (plist-get o :duration)) + "-min talk" (if (plist-get o :q-and-a) (format " followed by %s Q&A (%s) " (plist-get o :q-and-a) @@ -506,13 +510,13 @@ resources." (let ((start (org-timestamp-to-time (org-timestamp-split-range timestamp))) (end (org-timestamp-to-time (org-timestamp-split-range timestamp t)))) (format - "
Times in different timezones:
%s
%s
Find out how to watch and participate
" + "
Times in different timezones:
%s
which is the same as:
%s
Find out how to watch and participate
" (format-time-string "%Y-%m-%dT%H:%M:%SZ" start t) (format-time-string "%Y-%m-%dT%H:%M:%SZ" end t) (emacsconf-timezone-string o emacsconf-timezone) (string-join (emacsconf-timezone-strings o - (seq-filter (lambda (zone) (string= emacsconf-timezone zone)) + (seq-remove (lambda (zone) (string= emacsconf-timezone zone)) emacsconf-timezones)) "
") emacsconf-year (plist-get (emacsconf-get-track (plist-get o :track)) :id))) @@ -564,7 +568,7 @@ ${pad-info}${irc-info}${status-info}${schedule-info}\n" (when is-live (emacsconf-publish-captions-in-wiki talk)) (when (eq emacsconf-publishing-phase 'schedule) (insert "\nThe following image shows where the talk is in the schedule for " - (format-time-string "%a %Y-%m-%d" (plist-get talk :start-time) emacsconf-timezone) ". Solid lines show talks with Q&A via BigBlueButton. Lashed lines show talks with Q&A via IRC or Etherpad." + (format-time-string "%a %Y-%m-%d" (plist-get talk :start-time) emacsconf-timezone) ". Solid lines show talks with Q&A via BigBlueButton. Dashed lines show talks with Q&A via IRC or Etherpad." (format "
\n" (plist-get talk :slug)) (let* ((width 800) (height 150) (talk-date (format-time-string "%Y-%m-%d" (plist-get talk :start-time) emacsconf-timezone)) @@ -932,8 +936,7 @@ Entries are sorted chronologically, with different tracks interleaved." :title (plist-get o :title) :url (concat "/" (plist-get o :url)) :speakers (plist-get o :speakers) - :q-and-a (plist-get o :q-and-a) - :qa-link (plist-get o :qa-link) + :q-and-a (plist-get o :qa-link) :watch (plist-get o :watch-url) :note (string-join @@ -1739,7 +1742,7 @@ This video is available under the terms of the Creative Commons Attribution-Shar :start-info (emacsconf-surround "" (plist-get talk :start) "" "") :end-info(emacsconf-surround " - " (plist-get talk :end) "" "") :track-info (emacsconf-surround (format " " (or (plist-get talk :track) "")) (plist-get talk :track) "" "") - :q-info (emacsconf-surround " Q&A: " (plist-get talk :q-and-a) "; " "") + :q-info (emacsconf-surround " Q&A: " (plist-get talk :qa-link) "; " "") :pad-info (emacsconf-surround " Etherpad; " "") :slug-info (emacsconf-surround " id:" (plist-get talk :slug) "" "") @@ -1840,35 +1843,34 @@ ${title-info} (defun emacsconf-publish-watch-pages () "Update /year/watch pages." (interactive) - (mapc (lambda (track) - (plist-put track :year emacsconf-year) - (plist-put track :stream (concat emacsconf-stream-base (plist-get track :id) ".webm")) - (plist-put track :stream-hires (concat emacsconf-stream-base (plist-get track :id) ".webm")) - (plist-put track :480p (concat emacsconf-stream-base (plist-get track :id) "-480p.webm")) - (plist-put track :webchat-channels (concat "emacsconf,emacsconf-" (plist-get track :id))) - (plist-put track :webchat (concat emacsconf-chat-base "?join=" (plist-get track :webchat-channels))) - (plist-put track :channel (concat "#emacsconf-" (plist-get track :id)))) - emacsconf-tracks) - (let* ((info (emacsconf-prepare-for-display (emacsconf-get-talk-info))) - (emacsconf-publishing-phase 'schedule) - (emacsconf-use-absolute-url t)) - (when emacsconf-directory - (emacsconf-publish-with-wiki-change - (make-directory (expand-file-name "watch" (expand-file-name emacsconf-year emacsconf-directory)) t) - (with-temp-file (expand-file-name "watch/info.md" (expand-file-name emacsconf-year emacsconf-directory)) - (insert "[[!sidebar content=\"\"]]" (emacsconf-publish-format-watch-index info))) - (mapc (lambda (track) - (with-temp-file (expand-file-name (format "%s/watch/%s.md" emacsconf-year (plist-get track :id)) - emacsconf-directory) - (insert (emacsconf-publish-format-watch-track (append track (list :title "")) info)))) - emacsconf-tracks))) - ;; Update live.emacsconf.org - (when emacsconf-publish-watch-directory - (make-directory (expand-file-name "watch" (expand-file-name emacsconf-year emacsconf-publish-watch-directory)) t) - (with-temp-file (expand-file-name "watch/index.html" (expand-file-name emacsconf-year emacsconf-publish-watch-directory)) - (insert "Watch EmacsConf" (emacsconf-publish-format-watch-index info) - -"

+ (let ((tracks + (mapcar (lambda (track) + (append (list :year emacsconf-year + :stream (concat emacsconf-stream-base (plist-get track :id) ".webm") + :stream-hires (concat emacsconf-stream-base (plist-get track :id) ".webm") + :480p (concat emacsconf-stream-base (plist-get track :id) "-480p.webm")) + track)) + emacsconf-tracks))) + (let* ((info (emacsconf-prepare-for-display (emacsconf-get-talk-info))) + (emacsconf-publishing-phase 'schedule) + (emacsconf-use-absolute-url t)) + (when emacsconf-directory + (emacsconf-publish-with-wiki-change + (make-directory (expand-file-name "watch" (expand-file-name emacsconf-year emacsconf-directory)) t) + (with-temp-file (expand-file-name "watch/info.md" (expand-file-name emacsconf-year emacsconf-directory)) + (insert "[[!sidebar content=\"\"]]" (emacsconf-publish-format-watch-index info))) + (mapc (lambda (track) + (with-temp-file (expand-file-name (format "%s/watch/%s.md" emacsconf-year (plist-get track :id)) + emacsconf-directory) + (insert (emacsconf-publish-format-watch-track (append track (list :title "")) info)))) + tracks))) + ;; Update live.emacsconf.org + (when emacsconf-publish-watch-directory + (make-directory (expand-file-name "watch" (expand-file-name emacsconf-year emacsconf-publish-watch-directory)) t) + (with-temp-file (expand-file-name "watch/index.html" (expand-file-name emacsconf-year emacsconf-publish-watch-directory)) + (insert "Watch EmacsConf" (emacsconf-publish-format-watch-index info) + + "

Depending on which media player you use, you may enter the stream address in a graphical user interface or provide it as an argument to the program when launching it from the terminal. @@ -1903,36 +1905,36 @@ when the host has opened the Q&A.

" - "")) - (mapc (lambda (track) - (make-directory (expand-file-name (format "%s/watch/%s" emacsconf-year (plist-get track :id)) emacsconf-publish-watch-directory) t) - (make-directory (expand-file-name (format "%s/watch/%s-480p" emacsconf-year (plist-get track :id)) emacsconf-publish-watch-directory) t) - (with-temp-file (expand-file-name (format "%s/watch/%s/index.html" emacsconf-year (plist-get track :id)) - emacsconf-publish-watch-directory) - (insert - (emacsconf-replace-plist-in-string - track - "Watch EmacsConf ${name} track") - (emacsconf-publish-format-watch-track (append track - (list :title - (emacsconf-replace-plist-in-string - track - "EmacsConf ${year}: ${name} track"))) - info) - "")) - (with-temp-file (expand-file-name (format "%s/watch/%s-480p/index.html" emacsconf-year (plist-get track :id)) - emacsconf-publish-watch-directory) - (insert - (emacsconf-replace-plist-in-string - track - "Watch EmacsConf ${name} track (low-res)") - (emacsconf-publish-format-watch-track - (append (list :stream (plist-get track :480p) - :title (emacsconf-replace-plist-in-string track "EmacsConf ${year}: ${name} track (low-res)")) - track) - info) - ""))) - emacsconf-tracks)))) + "")) + (mapc (lambda (track) + (make-directory (expand-file-name (format "%s/watch/%s" emacsconf-year (plist-get track :id)) emacsconf-publish-watch-directory) t) + (make-directory (expand-file-name (format "%s/watch/%s-480p" emacsconf-year (plist-get track :id)) emacsconf-publish-watch-directory) t) + (with-temp-file (expand-file-name (format "%s/watch/%s/index.html" emacsconf-year (plist-get track :id)) + emacsconf-publish-watch-directory) + (insert + (emacsconf-replace-plist-in-string + track + "Watch EmacsConf ${name} track") + (emacsconf-publish-format-watch-track (append track + (list :title + (emacsconf-replace-plist-in-string + track + "EmacsConf ${year}: ${name} track"))) + info) + "")) + (with-temp-file (expand-file-name (format "%s/watch/%s-480p/index.html" emacsconf-year (plist-get track :id)) + emacsconf-publish-watch-directory) + (insert + (emacsconf-replace-plist-in-string + track + "Watch EmacsConf ${name} track (low-res)") + (emacsconf-publish-format-watch-track + (append (list :stream (plist-get track :480p) + :title (emacsconf-replace-plist-in-string track "EmacsConf ${year}: ${name} track (low-res)")) + track) + info) + ""))) + tracks))))) (defvar emacsconf-publish-current-dir "/ssh:orga@media.emacsconf.org:/var/www/media.emacsconf.org/2022/current" @@ -1996,9 +1998,10 @@ There is no live Q&A room for ${title}. You can find more information about the (regexp-quote (plist-get talk :video-slug)) (regexp-opt emacsconf-main-extensions))))) (mapc (lambda (file) - - (copy-file (expand-file-name file emacsconf-backstage-dir) - (expand-file-name file emacsconf-public-media-directory) t)) + (when (or (not (string-match "--main.vtt$" file)) + (plist-get talk :captions-edited)) + (copy-file (expand-file-name file emacsconf-backstage-dir) + (expand-file-name file emacsconf-public-media-directory) t))) files)) ;; Remove files from public (let ((files (directory-files emacsconf-public-media-directory nil diff --git a/emacsconf-schedule.el b/emacsconf-schedule.el index f4cdeda..7c9c060 100644 --- a/emacsconf-schedule.el +++ b/emacsconf-schedule.el @@ -642,16 +642,24 @@ Both start and end time are tested." "Write the proposed schedule to FILENAME using the variables in VARLIST. If emacsconf-schedule-apply is non-nil, update `emacsconf-org-file' and the wiki." (declare (debug t)) - `(let* (,@varlist) - (let* ((schedule (emacsconf-schedule-prepare arranged)) - (info (if emacsconf-schedule-expected-talks - (emacsconf-schedule-inflate-sexp emacsconf-schedule-expected-talks) - (emacsconf-get-talk-info))) - (validation (or (emacsconf-schedule-validate schedule info) ""))) - (with-temp-file ,filename - (svg-print (emacsconf-schedule-svg 800 200 schedule))) - (clear-image-cache) - (mapconcat (lambda (o) (format "- %s\n" o)) (append validation (list (format "[[file:%s]]" filename))))))) + `(prog1 + (let* (,@varlist) + (let* ((schedule (emacsconf-schedule-prepare arranged)) + (info (if emacsconf-schedule-expected-talks + (emacsconf-schedule-inflate-sexp emacsconf-schedule-expected-talks) + (emacsconf-get-talk-info))) + (validation (or (emacsconf-schedule-validate schedule info) ""))) + (when (and (boundp 'emacsconf-schedule-apply) emacsconf-schedule-apply) + (emacsconf-schedule-update-from-info schedule)) + (with-temp-file ,filename + (svg-print (emacsconf-schedule-svg 800 200 schedule))) + (clear-image-cache) + (mapconcat (lambda (o) (format "- %s\n" o)) (append validation (list (format "[[file:%s]]" filename)))))) + (when (and (boundp 'emacsconf-schedule-apply) emacsconf-schedule-apply) + (emacsconf-publish-before-pages) + (emacsconf-publish-schedule) + ;; (emacsconf-update-schedule) + ))) (defun emacsconf-schedule-format-summary-row (o) (pcase emacsconf-focus diff --git a/emacsconf.el b/emacsconf.el index a3fc06c..b5a846d 100644 --- a/emacsconf.el +++ b/emacsconf.el @@ -589,9 +589,11 @@ (plist-get o :slug))) (let ((track (emacsconf-get-track (plist-get o :track)))) (when track - (plist-put o :watch-url (concat emacsconf-base-url emacsconf-year "/watch/" (plist-get track :id)))) + (plist-put o :watch-url (concat emacsconf-base-url emacsconf-year "/watch/" (plist-get track :id))) + (plist-put o :webchat-url (concat emacsconf-chat-base "?join=emacsconf," + (replace-regexp-in-string "#" "" + (plist-get track :channel))))) (plist-put o :channel (plist-get track :channel)) - (plist-put o :webchat-url (concat emacsconf-chat-base "?join=emacsconf," (plist-get track :channel))) (plist-put o :bbb-backstage (concat emacsconf-media-base-url emacsconf-year "/backstage/current/room/" (plist-get o :slug))) (cond ((string= (or (plist-get o :q-and-a) "") "") @@ -602,12 +604,17 @@ (plist-put o :qa-info (plist-get o :bbb-redirect)) (plist-put o :qa-link (format "BBB" (plist-get o :bbb-redirect)))) ((string-match "IRC" (plist-get o :q-and-a)) - (plist-put o :qa-info (concat (emacsconf-surround "nick: " (plist-get o :irc) ", " "") - (plist-get o :channel))) + (plist-put o :qa-info (concat "#" (plist-get o :channel) + (emacsconf-surround ", speaker nick: " (plist-get o :irc) ""))) (plist-put o :qa-link (format "%s" (plist-get o :webchat-url) (plist-get o :qa-info)))) ((string-match "Mumble" (plist-get o :q-and-a)) (plist-put o :qa-info "Moderated via Mumble, ask questions via pad or IRC") (plist-put o :qa-link (format "%s" (plist-get o :webchat-url) (plist-get o :qa-info)))) + ((string-match "pad" (plist-get o :q-and-a)) + (plist-put o :qa-info "Etherpad") + (plist-put o :qa-link (format "%s" + (plist-get o :pad-url) + (plist-get o :qa-info)))) (t (plist-put o :qa-info "none") (plist-put o :qa-link "none"))) (plist-put o :pad-url (format "https://pad.emacsconf.org/%s-%s" emacsconf-year (plist-get o :slug))) -- cgit v1.2.3