diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-12-21 09:47:29 -0500 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-12-21 09:47:29 -0500 |
commit | 7ff8f33b89acd67a8f30ad068f8575b77022dd8e (patch) | |
tree | 6d2c0327ea9239aa3cb79df77ce044ea6d69f757 /emacsconf.el | |
parent | 38a7562df8daadfee638ec34a1a0adc8f56899ce (diff) | |
download | emacsconf-el-7ff8f33b89acd67a8f30ad068f8575b77022dd8e.tar.xz emacsconf-el-7ff8f33b89acd67a8f30ad068f8575b77022dd8e.zip |
publishing talk files, use the wiki as the main copy if it exists
Diffstat (limited to 'emacsconf.el')
-rw-r--r-- | emacsconf.el | 22 |
1 files changed, 13 insertions, 9 deletions
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 |