aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp/my/my-media-segment.el
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2024-10-11 19:45:02 +1100
committerYuchen Pei <id@ypei.org>2024-10-11 20:22:33 +1100
commitb4068a7ad802f5a3b2bb014412e2f88ccf8384ea (patch)
tree93a309baf2ec5d532ca1e8953853a02bad468d54 /emacs/.emacs.d/lisp/my/my-media-segment.el
parentcad78064b1cd76fc63b3c115a35e54dc6b91015c (diff)
[emacs] [bash] Several improvements
* emacs/.emacs.d/lisp/my/my-media-segment.el: Add index to filename formatting in `my-segment-media-file-1' * emacs/.emacs.d/lisp/my/my-utils.el: Add .spc to audio extensions * emacs/.emacs.d/lisp/my/my-ytdl.el: add command to download audio without tor * misc/.bashrc: pacman and systemd aliases; automate some arch aur make process; add pdf merge / extract functions using ghostscript
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-media-segment.el')
-rw-r--r--emacs/.emacs.d/lisp/my/my-media-segment.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-media-segment.el b/emacs/.emacs.d/lisp/my/my-media-segment.el
index 0cef817..f222316 100644
--- a/emacs/.emacs.d/lisp/my/my-media-segment.el
+++ b/emacs/.emacs.d/lisp/my/my-media-segment.el
@@ -63,6 +63,7 @@ Uses `my-media-segment-max-inflight' to limit number of inflight tasks."
(insert-file-contents desc-file-name)
(buffer-string))))
(total (length info))
+ (pad (1+ (floor (log10 total))))
(idx 0)
(thunk))
(dolist (media info)
@@ -74,8 +75,9 @@ Uses `my-media-segment-max-inflight' to limit number of inflight tasks."
(args (append (list "-ss" start)
(when end (list "-to" end))
(list "-i" (expand-file-name media-file-name)
- (format "%s/%s.%s" dir title
- (file-name-extension media-file-name))))))
+ (format
+ (format "%%s/%%0%dd-%%s.%%s" pad) dir idx title
+ (file-name-extension media-file-name))))))
(setq thunk
(lambda ()
(message "Cutting %s-%s to %s (%d/%d)..."