diff --git a/src/invidious.cr b/src/invidious.cr index dc52467e..799dd1a4 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -450,11 +450,11 @@ get "/search" do |env| end end - query = (query.split(" ") - operators).join(" ") + search_query = (query.split(" ") - operators).join(" ") search_params = build_search_params(sort: sort, date: date, content_type: "video", duration: duration, features: features) - count, videos = search(query, page, search_params).as(Tuple) + count, videos = search(search_query, page, search_params).as(Tuple) templated "search" end diff --git a/src/invidious/search.cr b/src/invidious/search.cr index e5b006bf..6baeba3e 100644 --- a/src/invidious/search.cr +++ b/src/invidious/search.cr @@ -38,9 +38,9 @@ def build_search_params(sort : String = "relevance", date : String = "", content "\x00" when "rating" "\x01" - when "upload_date" + when "upload_date", "date" "\x02" - when "view_count" + when "view_count", "views" "\x03" else raise "No sort #{sort}" @@ -92,7 +92,7 @@ def build_search_params(sort : String = "relevance", date : String = "", content "\x20\x01" when "subtitles" "\x28\x01" - when "creative_commons" + when "creative_commons", "cc" "\x30\x01" when "3d" "\x38\x01" diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index 85b6e416..6f6df8e0 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -