summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsyeopite <syeopite@syeopite.dev>2021-05-08 20:07:07 -0700
committersyeopite <syeopite@syeopite.dev>2021-09-24 21:07:07 -0700
commit7b60dac526c5df118c39bf428c0778a7a7982c98 (patch)
tree9e95e489947b540fc6772de82675dbe6ee5cc813 /src
parentea6434662daf97e8710fe4d2a4943112994ce760 (diff)
downloadinvidious-7b60dac526c5df118c39bf428c0778a7a7982c98.tar.gz
invidious-7b60dac526c5df118c39bf428c0778a7a7982c98.tar.bz2
invidious-7b60dac526c5df118c39bf428c0778a7a7982c98.zip
Add description_html field to Category
(cherry picked from commit aa8f15f795787113e56473f8e8fd606749a14bdd)
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/extractors.cr4
-rw-r--r--src/invidious/helpers/invidiousitems.cr1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/invidious/helpers/extractors.cr b/src/invidious/helpers/extractors.cr
index cd3b1f93..48885d48 100644
--- a/src/invidious/helpers/extractors.cr
+++ b/src/invidious/helpers/extractors.cr
@@ -256,6 +256,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
@@ -278,6 +281,7 @@ private class CategoryParser < ItemParser
Category.new({
title: title,
contents: contents,
+ description_html: description_html,
browse_endpoint_data: browse_endpoint_data,
badges: badges,
})
diff --git a/src/invidious/helpers/invidiousitems.cr b/src/invidious/helpers/invidiousitems.cr
index 65f755e6..2db838ea 100644
--- a/src/invidious/helpers/invidiousitems.cr
+++ b/src/invidious/helpers/invidiousitems.cr
@@ -232,6 +232,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))?
def to_json(locale, json : JSON::Builder)