mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
* 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>
This commit is contained in:
parent
39c27f0c66
commit
3dc980e800
1 changed files with 8 additions and 1 deletions
|
@ -237,8 +237,15 @@ class Category
|
||||||
|
|
||||||
def to_json(locale, json : JSON::Builder)
|
def to_json(locale, json : JSON::Builder)
|
||||||
json.object do
|
json.object do
|
||||||
|
json.field "type", "category"
|
||||||
json.field "title", self.title
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue