mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-02-15 04:56:16 +00:00
Search: Don't extract items from categories too
This commit is contained in:
@@ -113,7 +113,7 @@ module Invidious::Search
|
||||
|
||||
case @type
|
||||
when .regular?, .playlist?
|
||||
items = unnest_items(Processors.regular(self))
|
||||
items = Processors.regular(self)
|
||||
#
|
||||
when .channel?
|
||||
items = Processors.channel(self)
|
||||
@@ -136,26 +136,5 @@ module Invidious::Search
|
||||
|
||||
return params
|
||||
end
|
||||
|
||||
# TODO: clean code
|
||||
private def unnest_items(all_items) : Array(SearchItem)
|
||||
items = [] of SearchItem
|
||||
|
||||
# Light processing to flatten search results out of Categories.
|
||||
# They should ideally be supported in the future.
|
||||
all_items.each do |i|
|
||||
if i.is_a? Category
|
||||
i.contents.each do |nest_i|
|
||||
if !nest_i.is_a? Video
|
||||
items << nest_i
|
||||
end
|
||||
end
|
||||
else
|
||||
items << i
|
||||
end
|
||||
end
|
||||
|
||||
return items
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user