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

@@ -23,7 +23,7 @@ def search(query, page = 1, search_params = build_search_params(content_type: "v
nodeset = html.xpath_nodes(%q(//ol[@class="item-section"]/li))
videos = extract_videos(nodeset)
return videos
return {nodeset.size, videos}
end
def build_search_params(sort_by = "relevance", date : String = "", content_type : String = "", duration : String = "", features : Array(String) = [] of String)