mirror of
https://github.com/iv-org/invidious.git
synced 2024-08-23 12:50:43 +02:00
Make search not include category items for now
This commit is contained in:
parent
2605b9c609
commit
ca4afd59f4
@ -231,20 +231,15 @@ def process_search_query(url_params, query, page, user, region)
|
|||||||
count, items = search(search_query, search_params, region).as(Tuple)
|
count, items = search(search_query, search_params, region).as(Tuple)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Light processing to extract items from categories.
|
# Light processing to ignore extracted items from categories for now.
|
||||||
# Categories should ideally be supported in the frontend in the future
|
# They should ideally be supported in the frontend in the future
|
||||||
extracted_items = [] of SearchItem | ChannelVideo
|
items_without_cate_items = [] of SearchItem | ChannelVideo
|
||||||
items.each do |i|
|
items.each do |i|
|
||||||
if i.is_a? Category
|
if i.is_a? Category
|
||||||
i.contents.each do |cate_items|
|
|
||||||
if cate_items.is_a?(SearchVideo | SearchPlaylist | SearchChannel)
|
|
||||||
extracted_items << cate_items
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
extracted_items << i
|
items_without_cate_items << i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
{search_query, count, extracted_items, url_params}
|
{search_query, count, items_without_cate_items, url_params}
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user