diff options
author | Thanos Apollo <[email protected]> | 2025-01-17 06:41:02 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2025-01-17 06:41:02 +0200 |
commit | 69a2d1588cc5f3fd09a93f69d80c97248b522c1c (patch) | |
tree | d6bb4ced48e796d8281d68e2c5cbe72dca53d204 | |
parent | b8877e61b58dfabcc30044680d0975b3c6b12052 (diff) |
* Adjust yeetube-play to get the id when point is at thumbnail.
-rw-r--r-- | yeetube.el | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -210,16 +210,19 @@ videos from.") (defun yeetube-play () "Play video at point in *yeetube* buffer." (interactive) - (let* ((id (tabulated-list-get-id)) - (entry-content (cadr (assoc id yeetube-content))) - (video-url (yeetube-get-url id)) - (video-title (aref entry-content (if yeetube-display-thumbnails-p 1 0))) - (proc (apply yeetube-play-function video-url - (when yeetube-mpv-modeline-mode (list video-title))))) - (when (processp proc) - (process-put proc :now-playing video-title)) - (push (list :url video-url :title video-title) yeetube-history) - (message "Playing: %s" video-title))) + (save-excursion + ;; When point is on thumbnail, id will be nil. + (and (null (tabulated-list-get-id)) (end-of-line)) + (let* ((id (tabulated-list-get-id)) + (entry-content (cadr (assoc id yeetube-content))) + (video-url (yeetube-get-url id)) + (video-title (aref entry-content (if yeetube-display-thumbnails-p 1 0))) + (proc (apply yeetube-play-function video-url + (when yeetube-mpv-modeline-mode (list video-title))))) + (when (processp proc) + (process-put proc :now-playing video-title)) + (push (list :url video-url :title video-title) yeetube-history) + (message "Playing: %s" video-title)))) ;;;###autoload (defun yeetube-replay () |