From d37b69fb20920b263e769446d333783602458822 Mon Sep 17 00:00:00 2001 From: Frank de Lange Date: Tue, 12 Oct 2021 13:29:53 +0000 Subject: [PATCH] Fix for #2488 - parse contents of search results of type=Category (returned on first page for universal (type=all) queries instead of returning an error. --- src/invidious/routes/api/v1/search.cr | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/invidious/routes/api/v1/search.cr b/src/invidious/routes/api/v1/search.cr index f3a6fa06..2c80fff3 100644 --- a/src/invidious/routes/api/v1/search.cr +++ b/src/invidious/routes/api/v1/search.cr @@ -36,7 +36,13 @@ module Invidious::Routes::API::V1::Search JSON.build do |json| json.array do search_results.each do |item| - item.to_json(locale, json) + if item.is_a?(Category) + item.contents.each do |cat_item| + cat_item.to_json(locale, json) + end + else + item.to_json(locale, json) + end end end end