summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-07-08 11:32:11 +0300
committerThanos Apollo <[email protected]>2023-07-08 11:32:11 +0300
commit496ca6a8fdac8e66d25f2547b649ee0094b74e92 (patch)
tree8a078c1e2f2a79ca05f14375be771d8c99fd7d0e
parentd006e10bd7068d26ff3e4013da8c09191ac1fc7f (diff)
yeetube-search: make yeetube-results limit only be a limiting factor
Previously the while loop would run until there are enough video-ids to satisfy yeetube-results-limit(which was a stupid design by me). Change to run loop while video-ids < limit & if search-forward VIDEO-ID succeeds. This also makes the previous error messages unnecessary.
-rw-r--r--yeetube.el14
1 files changed, 4 insertions, 10 deletions
diff --git a/yeetube.el b/yeetube.el
index 410680a..7db8f60 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -192,16 +192,10 @@ PREFIX [[URL/watch?v=VIDEOID][VIDEOTITLE ]]"
t t)
(goto-char (point-min))
(toggle-enable-multibyte-characters)
- (while (< (length video-ids) yeetube-results-limit)
- (condition-case err
- (if is-youtube?
- (search-forward "videoId")
- (search-forward "watch?v"))
- (error
- (display-warning 'yeetube
- (format
- "Unable to find enough results, reduce yeetube-results-limit (%s)"
- (error-message-string err)))))
+ (while (and (< (length video-ids) yeetube-results-limit)
+ (if is-youtube?
+ (search-forward "videoId" nil t)
+ (search-forward "watch?v" nil t)))
(let* ((start (point))
(end (if is-youtube?
(search-forward ",")