Skip to content

Commit 7dad83d

Browse files
committed
refactor(empv): cleanup and refactor
1 parent 3a6ae2d commit 7dad83d

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

modules/me-media.el

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828
:when (executable-find +mpv-command)
2929
:custom
3030
(empv-invidious-instance "https://invidious.privacydev.net/api/v1") ; Pick from: https://api.invidious.io
31-
(empv-audio-dir "~/Music")
32-
(empv-video-dir "~/Videos")
33-
(empv-max-directory-search-depth 6)
34-
(empv-radio-log-file (expand-file-name "logged-radio-songs.org" org-directory))
31+
(empv-radio-log-file (concat org-directory "logged-radio-songs.org"))
3532
(empv-audio-file-extensions '("webm" "mp3" "ogg" "wav" "m4a" "flac" "aac" "opus"))
3633
:config
3734
(defun +empv--dl-playlist (playlist &optional dist)
@@ -43,18 +40,13 @@
4340
#'identity ; Filter nils
4441
(mapcar
4542
(lambda (item)
46-
(when-let
47-
((vid (when (string-match
48-
(rx (seq "watch?v=" (group-n 1 (one-or-more (or alnum "_" "-")))))
49-
item)
50-
(match-string 1 item))))
51-
vid))
43+
(and (string-match (rx (seq "watch?v=" (group-n 1 (* (any alnum "_" "-"))))) item)
44+
(match-string 1 item)))
5245
playlist)))
5346
(proc-name "empv-yt-dlp"))
5447
(unless (zerop (length vids))
5548
(message "Downloading %d songs to %s" (length vids) default-directory)
56-
(when (get-process proc-name)
57-
(kill-process proc-name))
49+
(when (get-process proc-name) (kill-process proc-name))
5850
(make-process :name proc-name
5951
:buffer (format "*%s*" proc-name)
6052
:command (append

0 commit comments

Comments
 (0)