summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com>2020-12-30 01:13:17 +0000
committerGitHub <noreply@github.com>2020-12-30 01:13:17 +0000
commit29278ff916d856ec47881d78031d81a8312571e3 (patch)
tree14c7a4553b1256b65e91f3c64dddf97792a68a41
parenta06dfaf82a7f643ccd95d5e114f84cf8eb739cb1 (diff)
parent608b9e66f4faa438d38a021c1c1885e789a431e2 (diff)
downloadinvidious-29278ff916d856ec47881d78031d81a8312571e3.tar.gz
invidious-29278ff916d856ec47881d78031d81a8312571e3.tar.bz2
invidious-29278ff916d856ec47881d78031d81a8312571e3.zip
Merge pull request #1620 from B0pol/community
fix channel/ID/community endpoint
-rw-r--r--src/invidious/channels.cr5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/invidious/channels.cr b/src/invidious/channels.cr
index 444a6eda..0f493eec 100644
--- a/src/invidious/channels.cr
+++ b/src/invidious/channels.cr
@@ -634,7 +634,8 @@ def fetch_channel_community(ucid, continuation, locale, format, thin_mode)
else
video_id = attachment["videoId"].as_s
- json.field "title", attachment["title"]["simpleText"].as_s
+ video_title = attachment["title"]["simpleText"]? || attachment["title"]["runs"]?.try &.[0]?.try &.["text"]?
+ json.field "title", video_title
json.field "videoId", video_id
json.field "videoThumbnails" do
generate_thumbnails(json, video_id)
@@ -656,7 +657,7 @@ def fetch_channel_community(ucid, continuation, locale, format, thin_mode)
json.field "published", published.to_unix
json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale))
- view_count = attachment["viewCountText"]["simpleText"].as_s.gsub(/\D/, "").to_i64? || 0_i64
+ view_count = attachment["viewCountText"]?.try &.["simpleText"].as_s.gsub(/\D/, "").to_i64? || 0_i64
json.field "viewCount", view_count
json.field "viewCountText", translate(locale, "`x` views", number_to_short_text(view_count))