mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-25 15:07:22 +00:00
Add description_html field to Category
This commit is contained in:
parent
b906f7a3f8
commit
aa8f15f795
@ -391,6 +391,7 @@ def fetch_channel_featured_channels(ucid, tab_data, view = nil, shelf_id = nil,
|
|||||||
return [Category.new({
|
return [Category.new({
|
||||||
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,
|
||||||
|
description_html: "",
|
||||||
browse_endpoint_data: nil,
|
browse_endpoint_data: nil,
|
||||||
badges: nil,
|
badges: nil,
|
||||||
auxiliary_data: auxiliary_data,
|
auxiliary_data: auxiliary_data,
|
||||||
@ -435,6 +436,7 @@ def fetch_channel_featured_channels(ucid, tab_data, view = nil, shelf_id = nil,
|
|||||||
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,
|
||||||
|
description_html: category.description_html,
|
||||||
browse_endpoint_data: nil,
|
browse_endpoint_data: nil,
|
||||||
badges: nil,
|
badges: nil,
|
||||||
auxiliary_data: category.auxiliary_data,
|
auxiliary_data: category.auxiliary_data,
|
||||||
@ -446,6 +448,7 @@ def fetch_channel_featured_channels(ucid, tab_data, view = nil, shelf_id = nil,
|
|||||||
category_array << Category.new({
|
category_array << Category.new({
|
||||||
title: fallback_title,
|
title: fallback_title,
|
||||||
contents: items,
|
contents: items,
|
||||||
|
description_html: "",
|
||||||
browse_endpoint_data: nil,
|
browse_endpoint_data: nil,
|
||||||
badges: nil,
|
badges: nil,
|
||||||
auxiliary_data: auxiliary_data,
|
auxiliary_data: auxiliary_data,
|
||||||
|
@ -258,6 +258,9 @@ private class CategoryParser < ItemParser
|
|||||||
badges << {badge["style"].as_s, badge["label"].as_s}
|
badges << {badge["style"].as_s, badge["label"].as_s}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Category description
|
||||||
|
description_html = item_contents["subtitle"]?.try { |desc| parse_content(desc) } || ""
|
||||||
|
|
||||||
# Content parsing
|
# Content parsing
|
||||||
contents = [] of SearchItem
|
contents = [] of SearchItem
|
||||||
|
|
||||||
@ -280,6 +283,7 @@ private class CategoryParser < ItemParser
|
|||||||
Category.new({
|
Category.new({
|
||||||
title: title,
|
title: title,
|
||||||
contents: contents,
|
contents: contents,
|
||||||
|
description_html: description_html,
|
||||||
browse_endpoint_data: browse_endpoint_data,
|
browse_endpoint_data: browse_endpoint_data,
|
||||||
badges: badges,
|
badges: badges,
|
||||||
auxiliary_data: auxiliary_data,
|
auxiliary_data: auxiliary_data,
|
||||||
|
@ -234,6 +234,7 @@ class Category
|
|||||||
property title : String
|
property title : String
|
||||||
property contents : Array(SearchItem)
|
property contents : Array(SearchItem)
|
||||||
property browse_endpoint_data : String?
|
property browse_endpoint_data : String?
|
||||||
|
property description_html : String
|
||||||
property badges : Array(Tuple(String, String))?
|
property badges : Array(Tuple(String, String))?
|
||||||
|
|
||||||
# Data unique to only specific types of categories.
|
# Data unique to only specific types of categories.
|
||||||
|
0
src/invidious/views/channel/home.ecr
Normal file
0
src/invidious/views/channel/home.ecr
Normal file
Loading…
Reference in New Issue
Block a user