Only show next page when there are more results

This commit is contained in:
Omar Roth
2018-08-25 17:18:43 -05:00
parent 78fcf579a7
commit 77b12b6249
4 changed files with 7 additions and 5 deletions

View File

@@ -2,13 +2,13 @@ def crawl_videos(db)
ids = Deque(String).new
random = Random.new
search(random.base64(3)).each do |video|
search(random.base64(3)).as(Tuple)[1].each do |video|
ids << video.id
end
loop do
if ids.empty?
search(random.base64(3)).each do |video|
search(random.base64(3)).as(Tuple)[1].each do |video|
ids << video.id
end
end