diff options
author | Thanos Apollo <[email protected]> | 2023-10-17 09:34:40 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-10-17 09:34:40 +0300 |
commit | f0dfd5508df5d33cbbc801a6e5a56b73b5aa3d7d (patch) | |
tree | 4244d6bbe7e8fb2eaa59a559311242bfe9c4d21b /yeetube-buffer.el | |
parent | 0a2719e72a8bb09d104044f0cf0c9ebf9485647b (diff) | |
parent | 1b4a3c46643cf08cf867d632078eaff446f2dd0c (diff) |
Merge version 2.0.7 branch to 'master'2.0.7
- Add yeetube-replay (replay entry stored in yeetube-history)
- Fix title issues & separate unicode character replacements into
yeetube--title-replacements
- Improve messages, for future debugging & aesthetics
- Redo storing of content info and retrieval, using keywords
This version marks yeetube.el in maintenance mode. I have no further
plans for further feature additions. However, feel free to discuss
with me any changes you'd like to see.
Diffstat (limited to 'yeetube-buffer.el')
-rw-r--r-- | yeetube-buffer.el | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/yeetube-buffer.el b/yeetube-buffer.el index 565d192..119c07f 100644 --- a/yeetube-buffer.el +++ b/yeetube-buffer.el @@ -75,22 +75,6 @@ Emojis cause formatting issues, this should be off by default." (equal (aref char-script-table c) 'emoji)) str)) -;; Usually titles from youtube get messed up, -;; This should fix some of the common issues. -(defun yeetube-buffer-fix-title (title) - "Adjust TITLE." - (let ((replacements '(("&" . "&") - (""" . "\"") - ("'" . "'") - ("u0026" . "&") - ("\\\\" . "")))) - (mapc (lambda (replacement) - (setf title (replace-regexp-in-string (car replacement) (cdr replacement) title))) - replacements) - (if yeetube-buffer-display-emojis - title - (yeetube-buffer-strip-emojis title)))) - (defun yeetube-buffer-fix-view-count (view-count) "Fix VIEW-COUNT display issues." (replace-regexp-in-string "[^0-9]" "" view-count)) @@ -183,12 +167,14 @@ 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 (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) |