From 093497894b84bcea46c2df7b5d360261b881693e Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sat, 22 Oct 2022 20:45:47 -0400 Subject: Backstage functions --- emacsconf-publish.el | 206 +++++++++++++++++++++++++++++++++------------------ emacsconf.el | 35 ++++++++- 2 files changed, 166 insertions(+), 75 deletions(-) diff --git a/emacsconf-publish.el b/emacsconf-publish.el index 06baa8d..b7a6073 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -115,7 +115,7 @@ (emacsconf-public-talks emacsconf-info) (format "https://media.emacsconf.org/%s/" emacsconf-year))) (when emacsconf-backstage-dir - (emacsconf-make-backstage-index (expand-file-name "index.html" emacsconf-backstage-dir))) + (emacsconf-publish-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) @@ -220,7 +220,7 @@ ${chapter-list} (if video-file (emacsconf-replace-plist-in-string info - "
  • Download .webm video (${video-duration}, ${video-file-size}B)
  • ") + "
  • Download video (${video-duration}, ${video-file-size}B)
  • ") ""))) "
    ")))) @@ -742,44 +742,74 @@ Entries are sorted chronologically, with different tracks interleaved." cancelled "\n")) "")))) -(defun emacsconf-make-backstage-index (filename) +(defun emacsconf-publish-talk-files (talk files) + (seq-filter (lambda (o) + (and (string-match (concat "^" (regexp-quote (plist-get talk :video-slug))) o) + (not (string= (plist-get talk :video-file) o)))) + files)) + +(defun emacsconf-sum (field talks) + (apply '+ (seq-map (lambda (talk) (string-to-number (or (plist-get talk field) "0"))) talks))) + +(defun emacsconf-publish-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))) + (by-status (seq-group-by (lambda (o) (plist-get o :status)) talks)) + (files (directory-files emacsconf-backstage-dir))) (insert "" - (format "

    Talks to be captioned (%d minutes)

    You can e-mail sacha@sachachua.com to call dibs on editing the captions for one of these talks.