mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Readd accidently removed category item unpacking
This commit is contained in:
parent
9ef5c47a5e
commit
9752616ab3
1 changed files with 16 additions and 1 deletions
|
@ -239,5 +239,20 @@ def process_search_query(url_params, query, page, user, region)
|
|||
count, items = search(search_query, search_params, region).as(Tuple)
|
||||
end
|
||||
|
||||
{search_query, count, items, url_params}
|
||||
# Light processing to flatten search results out of Categories.
|
||||
# They should ideally be supported in the future.
|
||||
items_without_category = [] 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_category << nest_i
|
||||
end
|
||||
end
|
||||
else
|
||||
items_without_category << i
|
||||
end
|
||||
end
|
||||
|
||||
{search_query, items_without_category.size, items_without_category, url_params}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue