diff options
author | Thanos Apollo <[email protected]> | 2024-09-27 00:40:55 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-09-27 00:40:55 +0300 |
commit | dc33d92a9c6765b7859551d19d1e910b81484726 (patch) | |
tree | 9542ff70802b57512ccb4f547e6ba8c2ee38cb31 | |
parent | bd5418635f3483930d267bcb44cd3744db4ea3ac (diff) |
[fix] channel-id-at-point: Retrieve channel using plist-get.
-rw-r--r-- | yeetube.el | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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" |