summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-10-14 13:57:48 +0300
committerThanos Apollo <[email protected]>2023-10-17 09:24:21 +0300
commit512a9a3bb5953bc62cc263899d3a888dd87a2090 (patch)
treeef799d756f61a3e890b228792f9666a9c5c9d86f
parent2663fb204f19a618d8b9eb70212dc0723e966725 (diff)
yeetube-buffer:(insert-content) Rewrite using keywords
-rw-r--r--yeetube-buffer.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/yeetube-buffer.el b/yeetube-buffer.el
index 565d192..0ef7134 100644
--- a/yeetube-buffer.el
+++ b/yeetube-buffer.el
@@ -183,12 +183,15 @@ Emojis cause formatting issues, this should be off by default."
(defun yeetube-buffer-insert-content (content)
"Insert formatted CONTENT."
(insert
- (concat (yeetube-buffer--format-title (yeetube-buffer-fix-title (car content)))
- (yeetube-buffer--format-view-count (yeetube-buffer-view-count-add-commas
- (yeetube-buffer-fix-view-count (nth 2 content))))
- (yeetube-buffer--format-video-duration (nth 3 content))
- (yeetube-buffer--format-channel (nth 4 content))
- "\n")))
+ (concat
+ (yeetube-buffer--format-title (yeetube-buffer-fix-title
+ (cl-getf content :title)))
+ (yeetube-buffer--format-view-count (yeetube-buffer-view-count-add-commas
+ (yeetube-buffer-fix-view-count
+ (cl-getf content :view-count))))
+ (yeetube-buffer--format-video-duration (cl-getf content :duration))
+ (yeetube-buffer--format-channel (cl-getf content :channel))
+ "\n")))
;;;###autoload
(defun yeetube-buffer-create (query content buffer-mode)