|
|
@ -380,7 +380,7 @@ def fetch_channel_playlists(ucid, author, continuation, sort_by)
|
|
|
|
return items, continuation
|
|
|
|
return items, continuation
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def fetch_channel_featured_channels(ucid, tab_data, view=nil, shelf_id=nil, continuation = nil, query_title = nil)
|
|
|
|
def fetch_channel_featured_channels(ucid, tab_data, view = nil, shelf_id = nil, continuation = nil, query_title = nil) : {Array(Category), (String|Nil)}
|
|
|
|
auxiliary_data = {} of String => String
|
|
|
|
auxiliary_data = {} of String => String
|
|
|
|
|
|
|
|
|
|
|
|
if continuation.is_a?(String)
|
|
|
|
if continuation.is_a?(String)
|
|
|
@ -392,10 +392,9 @@ def fetch_channel_featured_channels(ucid, tab_data, view=nil, shelf_id=nil, cont
|
|
|
|
title: query_title.not_nil!, # If continuation contents is requested then the query_title has to be passed along.
|
|
|
|
title: query_title.not_nil!, # If continuation contents is requested then the query_title has to be passed along.
|
|
|
|
contents: items,
|
|
|
|
contents: items,
|
|
|
|
browse_endpoint_data: nil,
|
|
|
|
browse_endpoint_data: nil,
|
|
|
|
continuation_token: continuation_token,
|
|
|
|
|
|
|
|
badges: nil,
|
|
|
|
badges: nil,
|
|
|
|
auxiliary_data: auxiliary_data,
|
|
|
|
auxiliary_data: auxiliary_data,
|
|
|
|
})]
|
|
|
|
})], continuation_token
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if view && shelf_id
|
|
|
|
if view && shelf_id
|
|
|
|
auxiliary_data["view"] = view
|
|
|
|
auxiliary_data["view"] = view
|
|
|
@ -414,7 +413,7 @@ def fetch_channel_featured_channels(ucid, tab_data, view=nil, shelf_id=nil, cont
|
|
|
|
|
|
|
|
|
|
|
|
# There's no submenu data if the channel doesn't feature any channels.
|
|
|
|
# There's no submenu data if the channel doesn't feature any channels.
|
|
|
|
if !submenu
|
|
|
|
if !submenu
|
|
|
|
return [] of Category
|
|
|
|
return {[] of Category, continuation_token}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
submenu_data = submenu["channelSubMenuRenderer"]["contentTypeSubMenuItems"]
|
|
|
|
submenu_data = submenu["channelSubMenuRenderer"]["contentTypeSubMenuItems"]
|
|
|
@ -436,8 +435,7 @@ def fetch_channel_featured_channels(ucid, tab_data, view=nil, shelf_id=nil, cont
|
|
|
|
category_array << Category.new({
|
|
|
|
category_array << Category.new({
|
|
|
|
title: category.title.empty? ? fallback_title : category.title,
|
|
|
|
title: category.title.empty? ? fallback_title : category.title,
|
|
|
|
contents: category.contents,
|
|
|
|
contents: category.contents,
|
|
|
|
browse_endpoint_data: category.browse_endpoint_data,
|
|
|
|
browse_endpoint_data: nil,
|
|
|
|
continuation_token: continuation_token,
|
|
|
|
|
|
|
|
badges: nil,
|
|
|
|
badges: nil,
|
|
|
|
auxiliary_data: category.auxiliary_data,
|
|
|
|
auxiliary_data: category.auxiliary_data,
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -445,17 +443,16 @@ def fetch_channel_featured_channels(ucid, tab_data, view=nil, shelf_id=nil, cont
|
|
|
|
|
|
|
|
|
|
|
|
# If we don't have any categories we'll create one.
|
|
|
|
# If we don't have any categories we'll create one.
|
|
|
|
if category_array.empty?
|
|
|
|
if category_array.empty?
|
|
|
|
return [Category.new({
|
|
|
|
category_array << Category.new({
|
|
|
|
title: fallback_title,
|
|
|
|
title: fallback_title,
|
|
|
|
contents: items,
|
|
|
|
contents: items,
|
|
|
|
browse_endpoint_data: nil,
|
|
|
|
browse_endpoint_data: nil,
|
|
|
|
continuation_token: continuation_token,
|
|
|
|
|
|
|
|
badges: nil,
|
|
|
|
badges: nil,
|
|
|
|
auxiliary_data: auxiliary_data,
|
|
|
|
auxiliary_data: auxiliary_data,
|
|
|
|
})]
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return category_array
|
|
|
|
return category_array, continuation_token
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -463,7 +460,7 @@ def produce_featured_channel_browse_param(view : Int64, shelf_id : Int64)
|
|
|
|
object = {
|
|
|
|
object = {
|
|
|
|
"2:string" => "channels",
|
|
|
|
"2:string" => "channels",
|
|
|
|
"4:varint" => view,
|
|
|
|
"4:varint" => view,
|
|
|
|
"14:varint" => shelf_id
|
|
|
|
"14:varint" => shelf_id,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
browse_params = object.try { |i| Protodec::Any.cast_json(object) }
|
|
|
|
browse_params = object.try { |i| Protodec::Any.cast_json(object) }
|
|
|
|