From 7ff8f33b89acd67a8f30ad068f8575b77022dd8e Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Wed, 21 Dec 2022 09:47:29 -0500 Subject: publishing talk files, use the wiki as the main copy if it exists --- emacsconf.el | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'emacsconf.el') diff --git a/emacsconf.el b/emacsconf.el index f7afc0c..39fe642 100644 --- a/emacsconf.el +++ b/emacsconf.el @@ -317,7 +317,7 @@ (cond ((and search (stringp search) (string-match "\\(.*?\\) - " search)) (match-string 1 search)) - ((and (stringp search) (string-match (concat "^" emacsconf-id "-" emacsconf-year "-\\(.+?\\)--") search)) + ((and (stringp search) (string-match (concat emacsconf-id "-" emacsconf-year "-\\(.+?\\)--") search)) (match-string 1 search)) (t search))) @@ -1466,14 +1466,18 @@ tracks with the ID in the cdr of that list." (mapcar (lambda (o) (plist-get o prop)) list)) (defun emacsconf-talk-file (talk suffix &optional always source) - (let ((filename (expand-file-name (concat (plist-get talk :video-slug) suffix) - (if (eq source 'wiki-captions) - (expand-file-name "captions" - (expand-file-name (plist-get talk :year) - emacsconf-directory)) - ) - emacsconf-cache-dir))) - (and (or always (file-exists-p filename)) filename))) + (let ((wiki-filename + (expand-file-name (concat (plist-get talk :video-slug) suffix) + (expand-file-name "captions" + (expand-file-name (plist-get talk :year) + emacsconf-directory)))) + (cache-filename + (expand-file-name (concat (plist-get talk :video-slug) suffix) + emacsconf-cache-dir))) + (cond + ((and (file-exists-p wiki-filename) (not (eq source 'cache))) wiki-filename) + ((and (file-exists-p cache-filename) (not (eq source 'wiki-captions))) cache-filename) + (always cache-filename)))) (provide 'emacsconf) ;;; emacsconf.el ends here -- cgit v1.2.3