diff options
author | Thanos Apollo <[email protected]> | 2023-08-16 06:13:33 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-08-16 06:13:33 +0300 |
commit | 129845151b6e325a73be065bbd50f008ddc04ca2 (patch) | |
tree | d83b1551e62ea00fac74e9418b5dcf4f7328463a /yeetube.el | |
parent | b36d316278609faa92a2134bff2bf973b597db20 (diff) |
fix: yeetube-toggle-pause-mpv error messages
Redo yeetube-toggle-pause-mpv error messages & docstring
Diffstat (limited to 'yeetube.el')
-rw-r--r-- | yeetube.el | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -220,16 +220,16 @@ It's recommended you keep it as the default value." (message (format "Yeetube Player: %s" yeetube-player)))) (defun yeetube-toggle-pause-mpv () - "Play/Pause mpv." + "Toggle play/pause mpv." (interactive) - (if (and (string-match "mpv" yeetube-player) - yeetube-socat) - (progn - (shell-command - (concat "echo '{ \"command\": [\"cycle\", \"pause\"] }' | " - yeetube-socat " - " yeetube-mpv-socket)) - (message "mpv play/pause")) - (error "To use this function you need have mpv & socat installed"))) + (unless yeetube-socat (error "Required program 'socat' not found")) + (unless (string-match "mpv" yeetube-player) + (error "Not using mpv as yeetube-player")) + (when (and (string-match "mpv" yeetube-player) yeetube-socat) + (shell-command + (format "echo '{ \"command\": [\"cycle\", \"pause\"] }' | %s - %s" + yeetube-socat yeetube-mpv-socket)) + (message "mpv toggle pause"))) ;; Usually titles from youtube get messed up, ;; This should fix some of the common issues. |