aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-02-25 11:54:22 +0200
committerThanos Apollo <[email protected]>2024-02-25 11:54:22 +0200
commit30fec227afc484a92444441b70668c3a2fbbec6c (patch)
tree6bed1fa82deb3f04856048a0274c04fd9c19e21c
parent3d75f432e184494f29efaca3e09e5ee4ad4c6152 (diff)
yeetube-get-thumbnails: Download only when yeetube-display-thumbnail
-rw-r--r--yeetube.el33
1 files changed, 17 insertions, 16 deletions
diff --git a/yeetube.el b/yeetube.el
index 2391f28..bdd772b 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -291,22 +291,23 @@ WHERE indicates where in the buffer the update should happen."
This is used to download thumbnails from `yeetube-content', within
`yeetube-search'. We can't as of now use images with tabulated-list."
(interactive)
- (let ((wget-exec (executable-find "wget"))
- (default-directory temporary-file-directory))
- (unless wget-exec
- (error "Please install `wget', to download thumbnails"))
- (cl-loop for item in content
- do (let ((thumbnail (plist-get item :thumbnail)))
- (call-process-shell-command
- (format "%s %s %s %s" wget-exec
- (shell-quote-argument thumbnail)
- "-O"
- (concat (replace-regexp-in-string
- "\\(.*\\)\\(\\(.\\{10\\}\\)\\)$"
- "\\2"
- thumbnail)
- ".jpg"))
- nil 0)))))
+ (when yeetube-display-thumbnails
+ (let ((wget-exec (executable-find "wget"))
+ (default-directory temporary-file-directory))
+ (unless wget-exec
+ (error "Please install `wget', to download thumbnails"))
+ (cl-loop for item in content
+ do (let ((thumbnail (plist-get item :thumbnail)))
+ (call-process-shell-command
+ (format "%s %s %s %s" wget-exec
+ (shell-quote-argument thumbnail)
+ "-O"
+ (concat (replace-regexp-in-string
+ "\\(.*\\)\\(\\(.\\{10\\}\\)\\)$"
+ "\\2"
+ thumbnail)
+ ".jpg"))
+ nil 0))))))
(defvar yeetube-filter-code-alist
'(("Relevance" . "EgIQAQ%253D%253D")