mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-28 16:28:29 +00:00
simplify check for continuationItemRenderer
Co-Authored-By: syeopite <70992037+syeopite@users.noreply.github.com> Co-Authored-By: Samantaz Fox <coding@samantaz.fr>
This commit is contained in:
parent
4627dbbe1c
commit
4119cecf75
@ -717,14 +717,14 @@ private module Extractors
|
||||
end
|
||||
|
||||
private def self.extract(target)
|
||||
raw_items = [] of Array(JSON::Any)
|
||||
raw_items = [] of JSON::Any
|
||||
|
||||
target.dig("primaryContents", "sectionListRenderer", "contents").as_a.each do |node|
|
||||
if new_node = node["itemSectionRenderer"]?
|
||||
raw_items << new_node["contents"].as_a
|
||||
end
|
||||
if node["continuationItemRenderer"]?
|
||||
raw_items.push([node])
|
||||
raw_items += new_node["contents"].as_a
|
||||
elsif node["continuationItemRenderer"]?
|
||||
# we put the node in an array so the ContinuationItemRendererParser is able to parse it
|
||||
raw_items << node
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user