mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Only show next page when there are more results
This commit is contained in:
parent
78fcf579a7
commit
77b12b6249
4 changed files with 7 additions and 5 deletions
|
@ -425,7 +425,7 @@ get "/search" do |env|
|
|||
page ||= 1
|
||||
|
||||
search_params = build_search_params(sort_by: "relevance", content_type: "video")
|
||||
videos = search(query, page, search_params)
|
||||
count, videos = search(query, page, search_params).as(Tuple)
|
||||
|
||||
templated "search"
|
||||
end
|
||||
|
@ -2365,7 +2365,7 @@ get "/api/v1/search" do |env|
|
|||
|
||||
response = JSON.build do |json|
|
||||
json.array do
|
||||
search_results = search(query, page, search_params)
|
||||
count, search_results = search(query, page, search_params).as(Tuple)
|
||||
search_results.each do |video|
|
||||
json.object do
|
||||
json.field "title", video.title
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue