From 0a7edf0d333d5959d75c9934ce23f19bb399b6e2 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Thu, 1 Dec 2022 19:23:36 -0500 Subject: intro checking --- emacsconf-publish.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'emacsconf-publish.el') diff --git a/emacsconf-publish.el b/emacsconf-publish.el index 2701cf1..f37c654 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -1585,8 +1585,10 @@ This video is available under the terms of the Creative Commons Attribution-Shar (let ((main (expand-file-name (concat (plist-get talk :video-slug) "--main.webm") emacsconf-cache-dir))) (emacsconf-with-talk-heading talk - (let* ((video-file-name (emacsconf-get-preferred-video (org-entry-get (point) "VIDEO_SLUG"))) + (let* ((video-file-name (emacsconf-get-preferred-video (plist-get talk :video-slug))) (video-file (and video-file-name (expand-file-name video-file-name emacsconf-cache-dir))) + (intro-file (expand-file-name (concat (plist-get talk :slug) ".webm") + (expand-file-name "intros" emacsconf-stream-asset-dir))) duration) (unless (file-exists-p main) (setq main video-file-name)) @@ -1603,7 +1605,11 @@ This video is available under the terms of the Creative Commons Attribution-Shar (unless (plist-get talk :video-duration) (setq duration (/ (compile-media-get-file-duration-ms video-file) 1000)) (org-entry-put (point) "VIDEO_DURATION" (format-seconds "%m:%.2s" duration)) - (org-entry-put (point) "VIDEO_TIME" (number-to-string (ceiling (/ duration 60)))))))))) + (org-entry-put (point) "VIDEO_TIME" (number-to-string (ceiling (/ duration 60)))))) + (when (file-exists-p intro-file) + (org-entry-put + (point) "INTRO_TIME" + (number-to-string (ceiling (/ (compile-media-get-file-duration-ms intro-file) 60000))))))))) (defvar emacsconf-youtube-channel-id "UCwuyodzTl_KdEKNuJmeo99A") (defun emacsconf-youtube-edit () -- cgit v1.2.3