From 56cc28bed338131ca82364718709f060347ab952 Mon Sep 17 00:00:00 2001 From: syeopite Date: Fri, 25 Jun 2021 10:16:11 -0700 Subject: [PATCH] Change behavior of categories in search results --- src/invidious/search.cr | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/invidious/search.cr b/src/invidious/search.cr index 5974dac0..b4171dac 100644 --- a/src/invidious/search.cr +++ b/src/invidious/search.cr @@ -232,11 +232,16 @@ def process_search_query(url_params, query, page, user, region) count, items = search(search_query, search_params, region).as(Tuple) end - # Light processing to ignore extracted items from categories for now. - # They should ideally be supported in the frontend in the future + # Light processing to flatten search results out of Categories. + # They should ideally be supported in the future. items_without_cate_items = [] of SearchItem | ChannelVideo items.each do |i| if i.is_a? Category + i.contents.each do |nest_i| + if !nest_i.is_a? Video + items_without_cate_items << nest_i + end + end else items_without_cate_items << i end