summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-08-19 04:57:42 +0300
committerThanos Apollo <[email protected]>2023-08-19 04:57:42 +0300
commit0dc06ff5d607f6297fee66793f6a689374962293 (patch)
treefc1e308a45f2328f108e9c2b2de9dfed11c1ef87
parent89138c3c9effd2b7d58510e7e215e29647682b9a (diff)
Rewrite yeetube-start-process
-rw-r--r--yeetube.el13
1 files changed, 4 insertions, 9 deletions
diff --git a/yeetube.el b/yeetube.el
index c103b84..f33e05a 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -209,21 +209,16 @@ Example Usage:
(when clear-saved
(setq yeetube-saved-videos nil))))
-(defun yeetube--mpv-play (url)
- "Use mpv to play URL."
- (let ((mpv (executable-find "mpv"))
- (socket (concat (temporary-file-directory) "yeetube-socket"))
- (process-name "yeetube"))
+(defun yeetube-start-process (command)
+ "Start yeetube process for shell COMMAND."
+ (let ((process-name "yeetube"))
(dolist (process (process-list))
(when (string-match process-name (process-name process))
(kill-process process)))
(sit-for 0.1)
(unless (get-process process-name)
(start-process-shell-command
- "yeetube" nil
- (if yeetube-mpv-disable-video
- (format "%s --no-video --input-ipc-server=%s %s" mpv socket url)
- (format "%s --input-ipc-server= %s %s" mpv socket url))))))
+ "yeetube" nil command))))
(defun yeetube-mpv-toggle-disable-video ()
"Disable/Enable video for mpv player."