diff options
author | Sacha Chua <sacha@sachachua.com> | 2023-10-25 12:23:54 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2023-10-25 12:24:14 -0400 |
commit | 0a33736e7a3f6ac88edf41dda534e729dab8b210 (patch) | |
tree | 9c0dfb3ed8166b1b81d4ea202c85e27d4e9c51e0 | |
parent | 754615cae03212134c0caf6f641763819afdf8aa (diff) | |
download | emacsconf-el-0a33736e7a3f6ac88edf41dda534e729dab8b210.tar.xz emacsconf-el-0a33736e7a3f6ac88edf41dda534e729dab8b210.zip |
always update media files to make it easy to unpublish
-rw-r--r-- | emacsconf-publish.el | 50 |
1 files 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) |