From 0a33736e7a3f6ac88edf41dda534e729dab8b210 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Wed, 25 Oct 2023 12:23:54 -0400 Subject: always update media files to make it easy to unpublish --- emacsconf-publish.el | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/emacsconf-publish.el b/emacsconf-publish.el index 4594ea1..0e1ac7e 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -2296,33 +2296,33 @@ There is no live Q&A room for ${title}. You can find more information about the "Publish the files and update the index." (interactive (list (emacsconf-complete-talk-info))) (let ((org-state (if (boundp 'org-state) org-state (plist-get talk :status)))) - (when (or (string= org-state "PLAYING") - (string= org-state "TO_STREAM")) - (if (plist-get talk :public) - ;; Copy main extension files from backstage to public - (let ((files (directory-files emacsconf-backstage-dir nil - (concat "^" - (regexp-quote (plist-get talk :file-prefix)) - (regexp-opt emacsconf-main-extensions))))) - (mapc (lambda (file) - (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 + (if (plist-get talk :public) + ;; Copy main extension files from backstage to public + (let ((files (directory-files emacsconf-backstage-dir nil (concat "^" - (regexp-quote (plist-get talk :file-prefix) - ))))) + (regexp-quote (plist-get talk :file-prefix)) + (regexp-opt emacsconf-main-extensions))))) (mapc (lambda (file) - (delete-file (expand-file-name file emacsconf-public-media-directory))) - files))) - (emacsconf-publish-public-index) - (emacsconf-publish-playlist - (expand-file-name "index.m3u" emacsconf-public-media-directory) - (concat emacsconf-name " " emacsconf-year) - (emacsconf-public-talks (emacsconf-get-talk-info)))))) + (when (and + (not (file-exists-p (expand-file-name file emacsconf-public-media-directory))) + (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 + (concat "^" + (regexp-quote (plist-get talk :file-prefix) + ))))) + (mapc (lambda (file) + (delete-file (expand-file-name file emacsconf-public-media-directory))) + files))) + (emacsconf-publish-public-index) + (emacsconf-publish-playlist + (expand-file-name "index.m3u" emacsconf-public-media-directory) + (concat emacsconf-name " " emacsconf-year) + (emacsconf-public-talks (emacsconf-get-talk-info))))) (defun emacsconf-publish-bbb-redirect-all () (interactive) -- cgit v1.2.3