summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-09-27 00:40:55 +0300
committerThanos Apollo <[email protected]>2024-09-27 00:40:55 +0300
commitdc33d92a9c6765b7859551d19d1e910b81484726 (patch)
tree9542ff70802b57512ccb4f547e6ba8c2ee38cb31
parentbd5418635f3483930d267bcb44cd3744db4ea3ac (diff)
[fix] channel-id-at-point: Retrieve channel using plist-get.
-rw-r--r--yeetube.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/yeetube.el b/yeetube.el
index 56d4652..77fef12 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -412,18 +412,18 @@ Image is inserted in BUFFER for ENTRY."
(if yeetube-filter (format "&sp=%s" (yeetube-get-filter-code yeetube-filter)) ""))))
(defun yeetube-channel-id-at-point ()
- "Return the channel name for the video at point."
- (if-let ((entry (tabulated-list-get-entry)))
- (get-text-property 0 :channel-id (aref entry 4))
- (error "No video at point")))
-
-(defun yeetube-channel-videos (channel-id)
- "View (some) videos for the channel with CHANNEL-ID."
- (interactive (list (yeetube-channel-id-at-point)))
+ "Return yeetube channel id at point."
+ (if-let ((id (tabulated-list-get-id)))
+ (get-text-property 0 :channel-id (plist-get id :channel))
+ (user-error "No video at point")))
+
+(defun yeetube-channel-videos (&optional channel-id)
+ "View videos for the channel with CHANNEL-ID."
+ (interactive (list (or (yeetube-channel-id-at-point) (format "@%s" (read-string "Channel: ")))))
(yeetube-display-content-from-url (format "https://youtube.com/%s/videos" channel-id)))
(defun yeetube-channel-search (channel-id query)
- "Search channel with CHANNEL-ID for vidoes matching QUERY."
+ "Search channel with CHANNEL-ID for videoes matching QUERY."
(interactive (list (yeetube-channel-id-at-point) (yeetube-read-query)))
(yeetube-display-content-from-url
(format "https://youtube.com/%s/search?query=%s"