Fix for #2488 - parse contents of search results of type=Category (#2496)

* 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.

* Moved content array walker to Category#to_json

As requested by reviewer this change moves the content array walker from the API endpoint to the Category class.

* Update src/invidious/helpers/serialized_yt_data.cr

Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
このコミットが含まれているのは:
Frank de Lange 2021-10-12 20:17:45 +02:00 committed by GitHub
コミット 3dc980e800
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更8行の追加1行の削除

ファイルの表示

@ -237,8 +237,15 @@ class Category
def to_json(locale, json : JSON::Builder)
json.object do
json.field "type", "category"
json.field "title", self.title
json.field "contents", self.contents
json.field "contents" do
json.array do
self.contents.each do |item|
item.to_json(locale, json)
end
end
end
end
end