diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-11-11 19:42:55 -0500 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-11-11 19:42:55 -0500 |
commit | 91149bcdf886fb155b042a2dd1234262eab7a8b9 (patch) | |
tree | 7b44ab0d1e3b84a59e61a57eb4007b282ef6f4ea | |
parent | a52fed488f520c8f28bf5fcf1e7f94919141fdcf (diff) | |
download | emacsconf-el-91149bcdf886fb155b042a2dd1234262eab7a8b9.tar.xz emacsconf-el-91149bcdf886fb155b042a2dd1234262eab7a8b9.zip |
FTP upload and backstage tweaks
-rw-r--r-- | emacsconf.el | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/emacsconf.el b/emacsconf.el index 2f5b6e2..d7a75fe 100644 --- a/emacsconf.el +++ b/emacsconf.el @@ -85,7 +85,10 @@ (defvar emacsconf-upload-dir "/ssh:orga@media.emacsconf.org:/srv/upload") (defvar emacsconf-res-dir (format "/ssh:orga@res.emacsconf.org:/data/emacsconf/%s" emacsconf-year)) (defvar emacsconf-media-extensions '("webm" "mkv" "mp4" "webm" "avi" "ts" "ogv" "wav" "ogg" "mp3")) - +(defvar emacsconf-ftp-upload-dir "/ssh:orga@media.emacsconf.org:/srv/ftp/anon/upload-here") +(defun emacsconf-ftp-upload-dired () + (interactive) + (dired emacsconf-ftp-upload-dir "-tl")) (defun emacsconf-upload-dired () (interactive) (dired emacsconf-upload-dir "-tl")) @@ -135,7 +138,8 @@ (copy-file file (expand-file-name (file-name-nondirectory file) emacsconf-backstage-dir) t) - (when emacsconf-cache-dir + (when (and emacsconf-cache-dir (not (string= (expand-file-name default-directory) + (expand-file-name emacsconf-cache-dir)))) (copy-file file (expand-file-name (file-name-nondirectory file) emacsconf-cache-dir) t))) @@ -152,18 +156,20 @@ (with-current-buffer (find-file-noselect (concat filename ".en.srv2")) (emacsconf-upload-to-backstage-and-rename talk "main--srt"))))) -(defun emacsconf-upload-to-backstage-and-rename (talk filename) - (interactive (list (emacsconf-complete-talk-info) - (read-string "Filename: "))) - (copy-file (buffer-file-name) - (expand-file-name (concat (plist-get talk :video-slug) - (if (string= filename "") - "" - (concat "--" filename)) - "." - (file-name-extension (buffer-file-name))) - emacsconf-backstage-dir) - t)) +(defun emacsconf-upload-to-backstage-and-rename (talk &optional filename) + (interactive (list (emacsconf-complete-talk-info))) + (mapc (lambda (file) + (let ((new-file (or filename (read-string (format "Filename (%s): " (file-name-base file)))))) + (copy-file file + (expand-file-name (concat (plist-get talk :video-slug) + (if (string= new-file "") + "" + (concat "--" new-file)) + "." + (file-name-extension file)) + emacsconf-backstage-dir) + t))) + (or (dired-get-marked-files) (list (buffer-file-name))))) (defun emacsconf-upload-copy-from-json (talk key filename) (interactive (let-alist (json-parse-string (buffer-string) :object-type 'alist) |