aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-04-06 20:43:31 +0300
committerThanos Apollo <[email protected]>2024-04-06 20:43:31 +0300
commitc443a9146b70f0b9697e2ee68356ac79a19bd81e (patch)
treef0cf650224fd9ef2bd682d829840a54356f2658f
parented7807cb7c8de3133cd1b503c0bbdeced1a5e6ab (diff)
yeetube: Add support for yeetube-modeline-mode
-rw-r--r--yeetube.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/yeetube.el b/yeetube.el
index c4a977f..3eb5ad3 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -228,7 +228,7 @@ Keywords:
(interactive)
(let* ((video-url (yeetube-get-url))
(video-title (yeetube-get :title))
- (proc (funcall yeetube-play-function video-url)))
+ (proc (funcall yeetube-play-function video-url (when yeetube-mpv-modeline-mode video-title))))
(when (processp proc)
(process-put proc :now-playing video-title))
(push (list :url video-url :title video-title) yeetube-history)
@@ -243,8 +243,9 @@ Select entry title from `yeetube-history' and play corresponding URL."
(let* ((titles (mapcar (lambda (entry) (cl-getf entry :title)) yeetube-history))
(selected (completing-read "Replay: " titles))
(selected-entry (cl-find-if (lambda (entry) (string= selected (cl-getf entry :title))) yeetube-history))
+ (title (cl-getf selected-entry :title))
(url (cl-getf selected-entry :url)))
- (funcall yeetube-play-function url)
+ (funcall yeetube-play-function url (when yeetube-mpv-modeline-mode title))
(message "Replaying: %s" selected)))
(defun yeetube-load-saved-videos ()
@@ -274,11 +275,14 @@ Select entry title from `yeetube-history' and play corresponding URL."
"Select & Play a saved video."
(interactive)
(yeetube-load-saved-videos)
- (let ((video (completing-read "Select video: " yeetube-saved-videos nil t)))
- (funcall yeetube-play-function (cdr (assoc video yeetube-saved-videos)))
+ (let* ((video (completing-read "Select video: " yeetube-saved-videos nil t))
+ (url (cdr (assoc video yeetube-saved-videos)))
+ (title (car (assoc video yeetube-saved-videos))))
+ (funcall yeetube-play-function url (when yeetube-mpv-modeline-mode title))
(message "Playing: %s" (car (assoc video yeetube-saved-videos)))))
;;;###autoload
+
(defun yeetube-remove-saved-video ()
"Select video to remove from saved videos."
(interactive)
@@ -658,12 +662,12 @@ A and B are vectors."
"Yeetube mode."
:keymap yeetube-mode-map
(setf tabulated-list-format
- [("Title" 60 t)
+ [("Title" 50 t)
("Views" 11 yeetube--sort-views)
("Duration" 9 yeetube--sort-duration)
("Date" 13 yeetube--sort-date)
("Channel" 12 t)
- ("Thumbnail" 0 nil)]
+ ("Thumbnail" 20 nil)]
tabulated-list-entries
(cl-map 'list
(lambda (content)
@@ -674,7 +678,7 @@ A and B are vectors."
:duration 'yeetube-face-duration
:date 'yeetube-face-date
:channel 'yeetube-face-channel
- :image nil)))
+ :image nil)))
yeetube-content)
tabulated-list-sort-key (cons yeetube-default-sort-column
yeetube-default-sort-ascending))