diff options
author | Thanos Apollo <[email protected]> | 2024-07-08 09:03:30 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-07-08 09:03:30 +0300 |
commit | 1511e1df030a864e434597f27f5dff074ebac12c (patch) | |
tree | e2793a9be9fbc9410327c019919903749d074023 | |
parent | b007b22f8c45efe046ca0d3a5a05e5f1a969a06e (diff) |
[fix] yeetube--image-callback: Adjust for new sorting funcs
-rw-r--r-- | yeetube.el | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -366,22 +366,27 @@ WHERE indicates where in the buffer the update should happen." Image is inserted in BUFFER for ENTRY." (let ((url-buffer (current-buffer))) (unwind-protect - (if-let ((err (plist-get :error status))) + (if-let ((err (plist-get status :error))) (message "Error %s in retrieving a thumbnail: %S" (car err) (cdr err)) (if-let ((handle (mm-dissect-buffer t)) (image (mm-get-image handle))) (progn (setf (image-property image :max-width) (car yeetube-thumbnail-size) - (image-property image :max-height) (cdr yeetube-thumbnail-size)) + (image-property image :max-height) (cdr yeetube-thumbnail-size)) + ;; Debugging Statement + ;; (message "Retrieved and processing image for %s" (plist-get entry :title)) (with-current-buffer buffer (with-silent-modifications (save-excursion (goto-char (point-min)) (search-forward (format "[[%s.jpg]]" (plist-get entry :id))) - (put-text-property (match-beginning 0) (match-end 0) 'display image) - (setf (aref (nth 0 (alist-get entry tabulated-list-entries)) 5) image))))) - (message "yeetube error: no image found"))) - (kill-buffer url-buffer)))) + ;; Ensure to remove the placeholder text + (delete-region (match-beginning 0) (match-end 0)) + (insert-image image) + ;; Debugging Statement + ;; (message "Inserted image for %s" (plist-get entry :title)) + (setf (aref (nth 0 (alist-get entry tabulated-list-entries)) 0) image)))))) + (kill-buffer url-buffer))))) (defun yeetube--retrieve-thumnail (url str buffer) "Retrieve thumbnail from URL and show it in place of STR in BUFFER." |