diff options
author | Thanos Apollo <[email protected]> | 2023-10-16 15:14:40 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-10-17 09:24:22 +0300 |
commit | af7eafc4c4d9106614d998ec553013431e68e749 (patch) | |
tree | f4e480a0c454ddf0e71597a5859fe7fc52edc5f2 | |
parent | f3196c8ecc11a425014358382811976ec5d68ce3 (diff) |
yeetube:(feature) Add yeetube-replay
Replay history entry
-rw-r--r-- | yeetube.el | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -128,6 +128,19 @@ Keywords: (push (list :url video-url :title video-title) yeetube-history) (message "Playing: %s" video-title))) +;;;###autoload +(defun yeetube-replay () + "Select entry from history to replay. + +Select entry title from yeetube-history and play corresponding URL." + (interactive) + (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)) + (url (cl-getf selected-entry :url))) + (funcall yeetube-player url) + (message "Replaying: %s" selected))) + (defun yeetube-load-saved-videos () "Load saved videos." (let ((file-path (concat user-emacs-directory "yeetube"))) |