summaryrefslogtreecommitdiff
path: root/yeetube.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2025-01-17 03:38:18 +0200
committerThanos Apollo <[email protected]>2025-01-17 03:38:18 +0200
commitd3e1750563b3a152e489e39e801eaed748e9d0d8 (patch)
tree725fcc9cf55b22796a54256044259fd76ffb07e7 /yeetube.el
parent5e34f1c0df72957afac186a66bef832d19e1478d (diff)
Remove yeetube-get
* Deprecated.
Diffstat (limited to 'yeetube.el')
-rw-r--r--yeetube.el32
1 files changed, 9 insertions, 23 deletions
diff --git a/yeetube.el b/yeetube.el
index c311414..351f9aa 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -196,29 +196,15 @@ videos from.")
(defvar yeetube--channel-id nil
"Value of channel which `yeetube-channel-videos' used for.")
-(defun yeetube-get (keyword)
- "Retrieve KEYWORD value for entry at point.
-
-Retrieve keyword value for entry at point, from `yeetube-content', in
-*yeetube* buffer.
-
-Keywords:
-- :title
-- :id
-- :type
-- :view-count
-- :duration
-- :channel"
- (unless (keywordp keyword)
- (error "Value `%s' is not a keyword" keyword))
- (cl-getf (tabulated-list-get-id) keyword))
-
-(defun yeetube-get-url (id type)
- "Get video or playlist url."
- (format "%s%s" (if (eq type 'video)
- yeetube-video-url
- yeetube-playlist-url)
- id))
+(defun yeetube-get-url (&optional id type)
+ "Get video or playlist url for entry ID, adjusted for TYPE."
+ (let* ((id (or id (tabulated-list-get-id)))
+ (entry (cadr (assoc id yeetube-content)))
+ (type (or type (aref entry (- (length entry) 1)))))
+ (format "%s%s" (if (eq type 'video)
+ yeetube-video-url
+ yeetube-playlist-url)
+ id)))
;;;###autoload
(defun yeetube-play ()