From 17b84f32df56f2df6849d13f3926bc20ad88081b Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Tue, 26 Feb 2019 14:31:37 -0600 Subject: [PATCH] Fix duration in /api/v1/search --- src/invidious.cr | 2 +- src/invidious/search.cr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index ce48f041..156e4cbf 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -3412,7 +3412,7 @@ get "/api/v1/search" do |env| date = env.params.query["date"]?.try &.downcase date ||= "" - duration = env.params.query["date"]?.try &.downcase + duration = env.params.query["duration"]?.try &.downcase duration ||= "" features = env.params.query["features"]?.try &.split(",").map { |feature| feature.downcase } diff --git a/src/invidious/search.cr b/src/invidious/search.cr index ce29abf2..ec97cf85 100644 --- a/src/invidious/search.cr +++ b/src/invidious/search.cr @@ -188,7 +188,7 @@ def produce_search_params(sort : String = "relevance", date : String = "", conte end end - if body.size > 0 + if !body.empty? token = head + "\x12" + body.size.unsafe_chr + body else token = head