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.

This commit is contained in:
Frank de Lange 2021-10-12 13:29:53 +00:00
parent 39c27f0c66
commit d37b69fb20

View File

@ -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