summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsyeopite <syeopite@syeopite.dev>2021-09-28 08:55:02 -0700
committersyeopite <syeopite@syeopite.dev>2021-09-28 08:55:02 -0700
commit23049e026f4c4f8fe02f8a911a717791345d44fa (patch)
treec1fc9430fd1c8fa35ca95c4e38e223f3156546c4 /src
parent9ab242ca2e79ecc8a196a019619fa3ddab31b28a (diff)
downloadinvidious-23049e026f4c4f8fe02f8a911a717791345d44fa.tar.gz
invidious-23049e026f4c4f8fe02f8a911a717791345d44fa.tar.bz2
invidious-23049e026f4c4f8fe02f8a911a717791345d44fa.zip
Improve readabltiy of SearchChannel auto-gen detect
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/extractors.cr4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/invidious/helpers/extractors.cr b/src/invidious/helpers/extractors.cr
index c6929162..83c751e0 100644
--- a/src/invidious/helpers/extractors.cr
+++ b/src/invidious/helpers/extractors.cr
@@ -142,7 +142,9 @@ private module Parsers
subscriber_count = item_contents.dig?("subscriberCountText", "simpleText")
.try { |s| short_text_to_number(s.as_s.split(" ")[0]) } || 0
- auto_generated = !item_contents["videoCountText"]? ? true : false
+ # Auto-generated channels doesn't have videoCountText
+ # Taken from: https://github.com/iv-org/invidious/pull/2228#discussion_r717620922
+ auto_generated = item_contents["videoCountText"]?.nil?
video_count = HelperExtractors.get_video_count(item_contents)
description_html = item_contents["descriptionSnippet"]?.try { |t| parse_content(t) } || ""