mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Add description_html field to Category
This commit is contained in:
parent
b906f7a3f8
commit
aa8f15f795
4 changed files with 8 additions and 0 deletions
|
@ -391,6 +391,7 @@ def fetch_channel_featured_channels(ucid, tab_data, view = nil, shelf_id = nil,
|
|||
return [Category.new({
|
||||
title: query_title.not_nil!, # If continuation contents is requested then the query_title has to be passed along.
|
||||
contents: items,
|
||||
description_html: "",
|
||||
browse_endpoint_data: nil,
|
||||
badges: nil,
|
||||
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({
|
||||
title: category.title.empty? ? fallback_title : category.title,
|
||||
contents: category.contents,
|
||||
description_html: category.description_html,
|
||||
browse_endpoint_data: nil,
|
||||
badges: nil,
|
||||
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({
|
||||
title: fallback_title,
|
||||
contents: items,
|
||||
description_html: "",
|
||||
browse_endpoint_data: nil,
|
||||
badges: nil,
|
||||
auxiliary_data: auxiliary_data,
|
||||
|
|
|
@ -258,6 +258,9 @@ private class CategoryParser < ItemParser
|
|||
badges << {badge["style"].as_s, badge["label"].as_s}
|
||||
end
|
||||
|
||||
# Category description
|
||||
description_html = item_contents["subtitle"]?.try { |desc| parse_content(desc) } || ""
|
||||
|
||||
# Content parsing
|
||||
contents = [] of SearchItem
|
||||
|
||||
|
@ -280,6 +283,7 @@ private class CategoryParser < ItemParser
|
|||
Category.new({
|
||||
title: title,
|
||||
contents: contents,
|
||||
description_html: description_html,
|
||||
browse_endpoint_data: browse_endpoint_data,
|
||||
badges: badges,
|
||||
auxiliary_data: auxiliary_data,
|
||||
|
|
|
@ -234,6 +234,7 @@ class Category
|
|||
property title : String
|
||||
property contents : Array(SearchItem)
|
||||
property browse_endpoint_data : String?
|
||||
property description_html : String
|
||||
property badges : Array(Tuple(String, String))?
|
||||
|
||||
# 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 a new issue