From a9525a21833c57aee9591856284e923bbccff029 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sun, 1 Dec 2024 20:02:35 -0500 Subject: add prefer_live property --- emacsconf-pad.el | 146 ++++++++++++++++++++++++++++--------------------- emacsconf-publish.el | 152 ++++++++++++++++++++++++++++++++------------------- emacsconf-stream.el | 43 ++++++++++++++- emacsconf.el | 33 +++++++---- 4 files changed, 245 insertions(+), 129 deletions(-) diff --git a/emacsconf-pad.el b/emacsconf-pad.el index 7cd5a8f..e3d3692 100644 --- a/emacsconf-pad.el +++ b/emacsconf-pad.el @@ -142,7 +142,9 @@ You can find it in $ETHERPAD_PATH/APIKEY.txt" (format "https://etherpad.wikimedia.org/p/emacsconf-%s-%s" emacsconf-year (plist-get o :slug)) - (concat emacsconf-pad-base emacsconf-pad-directory (emacsconf-pad-id o)))) + (if (and (listp o) (plist-get o :slug)) + (concat emacsconf-pad-base emacsconf-pad-directory (emacsconf-pad-id o)) + (concat emacsconf-pad-base o)))) (defvar emacsconf-pad-number-of-next-talks 3 "Integer limiting the number of next talks to link to from the pad.") @@ -339,6 +341,7 @@ ${next-talk-list} (defun emacsconf-pad-format-shift-hyperlist (shift info) (let* ((track (emacsconf-get-track (plist-get shift :track))) + (shift-rtmp (seq-find (lambda (entry) (string= (assoc-default "ID" entry) (plist-get shift :id))) emacsconf-rtmp-shifts)) (prefixed (list :start (plist-get shift :start) :end (plist-get shift :end) @@ -353,9 +356,16 @@ ${next-talk-list} :irc-volunteer (format "%s" (emacsconf-surround "IRC-" (plist-get shift :irc) "" "IRC")) :track-id (plist-get track :id) :conf-id emacsconf-id + :channel (concat emacsconf-id "-" (plist-get track :id)) :checkin (format "%s" (emacsconf-surround "CHECKIN-" (plist-get shift :checkin) "" "CHECKIN")) :pad (format "%s" (emacsconf-surround "PAD-" (plist-get shift :pad) "" "PAD")) :coord (format "%s" (emacsconf-surround "COORD-" (plist-get shift :coord) "" "COORD")) + :youtube-rtmp (assoc-default "YouTube" shift-rtmp 'string=) + :youtube-studio-url (assoc-default "YouTube URL" shift-rtmp 'string=) + :youtube-view-url + (replace-regexp-in-string + "https://studio\\.youtube\\.com/video/\\([^/]+\\)/livestreaming" "https://youtube.com/live/\\1" + (assoc-default "YouTube URL" shift-rtmp 'string=)) :checkin-pad (concat emacsconf-pad-base "checkin-" (downcase (format-time-string "%a" (date-to-time (plist-get shift :start))))))) (shift-talks (mapcar (lambda (o) (append prefixed o)) @@ -384,29 +394,29 @@ ${next-talk-list} Setup " "Teardown ")) ))) @@ -514,7 +524,7 @@ ${bbb-checklist}") (emacsconf-publish-prepare-for-display (emacsconf-get-talk-info))))) (mapc (lambda (day) - (let ((pad-id (concat "checkin-" (downcase (format-time-string "%a" (plist-get (cadr day) :checkin-time)))))) + (let ((pad-id (concat "private-" emacsconf-private-pad-prefix "-checkin-" (downcase (format-time-string "%a" (plist-get (cadr day) :checkin-time)))))) (emacsconf-pad-create-pad pad-id) (emacsconf-pad-set-html pad-id @@ -551,7 +561,9 @@ ${bbb-checklist}") :base-url emacsconf-base-url :year emacsconf-year :checkin-list (mapconcat - (lambda (day) (concat "
  • " emacsconf-pad-base "checkin-" + (lambda (day) (concat "
  • " emacsconf-pad-base + id + "-checkin-" (downcase (format-time-string "%a" (plist-get (cadr day) :checkin-time))) "
  • ")) (seq-group-by (lambda (talk) @@ -561,18 +573,19 @@ ${bbb-checklist}") "") :shift-list (mapconcat (lambda (shift) - (format "
  • %sprivate-%s-%s-%s
  • " + (format "
  • %s%s-%s
  • " emacsconf-pad-base - emacsconf-private-pad-prefix - emacsconf-year + id (plist-get shift :id))) emacsconf-shifts "") :host-list (mapconcat (lambda (shift) - (format "
  • %shost-%s
  • " + (format "
  • %sprivate-%s-%s-host-%s
  • " emacsconf-pad-base + emacsconf-private-pad-prefix + emacsconf-year (plist-get shift :id))) emacsconf-shifts "") @@ -589,7 +602,14 @@ ${bbb-checklist}")
    Combined shift info:
    -")))) +")) + (emacsconf-pad-url id))) + +(defun emacsconf-pad-shift-hyperlist-id (shift) + (format "private-%s-%s-%s" + emacsconf-private-pad-prefix + emacsconf-year + (plist-get (emacsconf-resolve-shift shift) :id))) (defun emacsconf-pad-prepopulate-shift-hyperlist (shift &optional info) (interactive (list (completing-read "Shift: " @@ -598,15 +618,17 @@ ${bbb-checklist}") (setq shift (seq-find (lambda (o) (string= (plist-get o :id) shift)) emacsconf-shifts))) (unless info (setq info (emacsconf-publish-prepare-for-display (emacsconf-get-talk-info)))) (let ((info (emacsconf-publish-prepare-for-display (emacsconf-get-talk-info))) - (pad-id (format "private-%s-%s-%s" - emacsconf-private-pad-prefix - emacsconf-year - (plist-get shift :id)))) + (pad-id (emacsconf-pad-shift-hyperlist-id shift))) (emacsconf-pad-create-pad pad-id) (emacsconf-pad-set-html pad-id (emacsconf-pad-format-shift-hyperlist shift info)))) +(defun emacsconf-pad-open-shift-hyperlist (shift) + (interactive (list (completing-read "Shift: " + (mapcar (lambda (o) (plist-get o :id)) emacsconf-shifts)))) + (browse-url (emacsconf-pad-url (emacsconf-pad-shift-hyperlist-id shift)))) + (defun emacsconf-pad-prepopulate-host-hyperlists () (interactive) (mapc #'emacsconf-pad-prepopulate-shift-hyperlist-host emacsconf-shifts)) @@ -618,7 +640,9 @@ ${bbb-checklist}") (setq shift (seq-find (lambda (o) (string= (plist-get o :id) shift)) emacsconf-shifts))) (unless info (setq info (emacsconf-publish-prepare-for-display (emacsconf-get-talk-info)))) (let ((info (emacsconf-publish-prepare-for-display (emacsconf-get-talk-info)))) - (let* ((pad-id (format "host-%s" + (let* ((pad-id (format "private-%s-%s-host-%s" + emacsconf-private-pad-prefix + emacsconf-year (plist-get shift :id))) (shift-talks (seq-filter @@ -667,40 +691,39 @@ ${bbb-checklist}") talk) (concat "${hyperlist-note-info}" - (cond - (;; live talk, join BBB - (null (plist-get talk :video-file)) - "
  • ${start-hhmm} ${slug} live talk: it should play a prerecorded intro, but if it doesn't, join ${bbb-backstage} and introduce talk, then turn it over to speaker for live talk: ${expanded-intro} (pronunciation: ${pronunciation})
  • ") - (t ;; prerecorded talk - "
  • Backup: ${start-hhmm} ${slug}: it should play a prerecorded intro and talk, but if it doesn't, join ${mumble} in Mumble and introduce talk: ${expanded-intro} (pronunciation: ${pronunciation}); then play ${slug}
  • ")) + (if (emacsconf-talk-recorded-p talk) + "
  • Backup: ${start-hhmm} ${slug}: it should play a prerecorded intro and talk, but if it doesn't, join ${mumble} in Mumble and introduce talk: ${expanded-intro} (pronunciation: ${pronunciation}); then play ${slug}
  • " + ;; live talk, join BBB + "
  • ${start-hhmm} ${slug} live talk: it should play a prerecorded intro, but if it doesn't, join ${bbb-backstage} (mod code ${bbb-mod-code} ) and introduce talk, then turn it over to speaker for live talk: ${expanded-intro} (pronunciation: ${pronunciation})
  • ") ;; Q&A - (if (and (null (plist-get talk :video-file)) (not (string= (or (plist-get talk :q-and-a) "none") "none"))) + (if (and (not (emacsconf-talk-prerecorded-p talk)) + (not (string= (or (plist-get talk :qa-type) "none") "none"))) "
  • Continue in the BBB room for live Q&A because the talk was live
  • " - (pcase (plist-get talk :q-and-a) + (pcase (plist-get talk :qa-type) ((or 'nil "" "none" (rx "after")) (if (plist-get talk :video-file) "
  • [ ] ${qa-hhmm} ${slug} Q&A after: Join ${mumble} in Mumble and say that the speaker will follow up with answers on the talk page afterwards. Read questions. ${pad-url}
  • " "")) - ((rx "IRC") + ((rx "irc") "
  • [ ] ${qa-hhmm} ${slug} Q&A IRC: Join ${mumble} in Mumble. Invite people to put their questions in the ${channel} IRC channel and read questions and answers from there. ${webchat-url} ${pad-url}
  • ") ((rx "pad") "
  • [ ] ${qa-hhmm} ${slug} Q&A pad: Join ${mumble} in Mumble. Invite people to put their questions in the Etherpad and read questions and answers from there. ${pad-url}
  • ") - ((rx "Mumble") + ((rx "mumble") "
  • [ ] ${qa-hhmm} ${slug} Q&A mumble: Join ${mumble} in Mumble. Bring the speaker into the right channel if needed. Invite people to put their questions in the Etherpad and read questions and answers from there. ${pad-url} Paste questions into Mumble chat or read them out loud.
  • ") ((rx "live") (concat - "
  • [ ] ${qa-hhmm} ${slug} Q&A live (on stream until ${end-of-qa}): Join ${bbb-backstage}. START RECORDING. Invite people to put their questions in the Etherpad, and read questions from there. ${pad-url}
  • + "
  • [ ] ${qa-hhmm} ${slug} Q&A live (on stream until ${end-of-qa}): Join ${bbb-backstage} (mod code ${bbb-mod-code} ). START RECORDING. Invite people to put their questions in the Etherpad, and read questions from there. ${pad-url}
  • ${open-qa} " - (if next-talk - " + (if next-talk + "
  • ${next-talk-in-5} [? Open Q&A is still going on and it's about five minutes before the next talk]
  • -
  • ${next-talk-in-1} [? Open Q&A is still going on and it's about a minute before the next talk] +
  • ${next-talk-in-2} [? Open Q&A is still going on and it's about 2 minutes before the next talk]
  • " - "")) -))))))) + "")) + ))))))) (emacsconf-include-next-talks shift-talks 1) "\n") ""))))) @@ -775,7 +798,7 @@ ${bbb-checklist}") :media-base emacsconf-media-base-url :mumble (concat emacsconf-id "-" track-id) :next-talk-in-5 (if next-talk (format-time-string "%-l:%M %p" (time-subtract (plist-get next-talk :start-time) (seconds-to-time 300)) emacsconf-timezone) "") - :next-talk-in-1 (if next-talk (format-time-string "%-l:%M %p" (time-subtract (plist-get next-talk :start-time) (seconds-to-time 60)) emacsconf-timezone) "") + :next-talk-in-2 (if next-talk (format-time-string "%-l:%M %p" (time-subtract (plist-get next-talk :start-time) (seconds-to-time 120)) emacsconf-timezone) "") :qa-start (format-time-string "%-l:%M %p" (plist-get talk :qa-time) emacsconf-timezone) :qa-end (if next-talk (format-time-string "%-l:%M %p" (plist-get next-talk :start-time)) "end of shift") @@ -809,17 +832,17 @@ ${bbb-checklist}") (concat (emacsconf-surround "
  • " (plist-get talk :hyperlist-note) "
  • " "") "
  • Recorded intro: ${media-base}${year}/backstage/${file-prefix}--intro.webm" - (if (plist-get talk :video-file) + (if (emacsconf-talk-recorded-p talk) "
  • [ ] [? stream didn't auto-play] ${stream}: handle-session ${slug}; if that doesn't work, play ${slug}; if that still doesn't work, track-mpv ~/current/cache/${conf-id}-${year}-${slug}*--intro.webm and track-mpv ~/current/cache/${conf-id}-${year}-${slug}*--main.webm
  • " (concat "
  • Live talk:
  • ")) - (pcase (or (plist-get talk :q-and-a) "") + (pcase (or (plist-get talk :qa-type) "") ((rx "live") (concat "
  • Live Q&A start ${qa-start}, on stream until ${qa-end}