summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaltycrys <73420320+saltycrys@users.noreply.github.com>2021-02-10 01:12:40 +0100
committerGitHub <noreply@github.com>2021-02-10 01:12:40 +0100
commitb2cfebcce237a4e419a78484cf2fbaac073ef6ff (patch)
tree01ae75fedb7925c6531dbe8f554138ed8d382373
parent55ce1ce3ece965e32cb5bd1f42bed97d855fd690 (diff)
parent2bf445e1655cacec40b927b87b32cd0adff6232e (diff)
downloadinvidious-b2cfebcce237a4e419a78484cf2fbaac073ef6ff.tar.gz
invidious-b2cfebcce237a4e419a78484cf2fbaac073ef6ff.tar.bz2
invidious-b2cfebcce237a4e419a78484cf2fbaac073ef6ff.zip
Merge pull request #1754 from saltycrys/fix-various-artists-playlist
Fix playlists with `Various Artists` author
-rw-r--r--src/invidious/helpers/helpers.cr4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr
index 00087143..944d869b 100644
--- a/src/invidious/helpers/helpers.cr
+++ b/src/invidious/helpers/helpers.cr
@@ -231,7 +231,7 @@ def extract_item(item : JSON::Any, author_fallback : String? = nil, author_id_fa
video_id = i["videoId"].as_s
title = i["title"].try { |t| t["simpleText"]?.try &.as_s || t["runs"]?.try &.as_a.map(&.["text"].as_s).join("") } || ""
- author_info = i["ownerText"]?.try &.["runs"].as_a[0]?
+ author_info = i["ownerText"]?.try &.["runs"]?.try &.as_a?.try &.[0]?
author = author_info.try &.["text"].as_s || author_fallback || ""
author_id = author_info.try &.["navigationEndpoint"]?.try &.["browseEndpoint"]["browseId"].as_s || author_id_fallback || ""
@@ -322,7 +322,7 @@ def extract_item(item : JSON::Any, author_fallback : String? = nil, author_id_fa
video_count = i["videoCount"]?.try &.as_s.to_i || 0
playlist_thumbnail = i["thumbnails"].as_a[0]?.try &.["thumbnails"]?.try &.as_a[0]?.try &.["url"].as_s || ""
- author_info = i["shortBylineText"]?.try &.["runs"].as_a[0]?
+ author_info = i["shortBylineText"]?.try &.["runs"]?.try &.as_a?.try &.[0]?
author = author_info.try &.["text"].as_s || author_fallback || ""
author_id = author_info.try &.["navigationEndpoint"]?.try &.["browseEndpoint"]["browseId"].as_s || author_id_fallback || ""