From dc33d92a9c6765b7859551d19d1e910b81484726 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 27 Sep 2024 00:40:55 +0300 Subject: [fix] channel-id-at-point: Retrieve channel using plist-get. --- yeetube.el | 18 +++++++++--------- 1 file 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" -- cgit v1.2.3