diff options
| author | Omar Roth <omarroth@hotmail.com> | 2019-04-12 16:29:23 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2019-04-12 16:29:23 -0500 |
| commit | ce2a3361eb906ea94981169a3b36d1848dfdee29 (patch) | |
| tree | 891349aad82c5847340bddbe562a32c4061125c9 /src | |
| parent | ca9ea109c62c8b3a576c27106dbf5855af7933ee (diff) | |
| download | invidious-ce2a3361eb906ea94981169a3b36d1848dfdee29.tar.gz invidious-ce2a3361eb906ea94981169a3b36d1848dfdee29.tar.bz2 invidious-ce2a3361eb906ea94981169a3b36d1848dfdee29.zip | |
Fix missing author name for channel_videos
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/channels.cr | 8 | ||||
| -rw-r--r-- | src/invidious/helpers/helpers.cr | 4 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/invidious/channels.cr b/src/invidious/channels.cr index 0eeb8a8b..9339d197 100644 --- a/src/invidious/channels.cr +++ b/src/invidious/channels.cr @@ -114,9 +114,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil) if auto_generated videos = extract_videos(nodeset) else - videos = extract_videos(nodeset, ucid) - videos.each { |video| video.ucid = ucid } - videos.each { |video| video.author = author } + videos = extract_videos(nodeset, ucid, author) end end @@ -184,9 +182,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil) if auto_generated videos = extract_videos(nodeset) else - videos = extract_videos(nodeset, ucid) - videos.each { |video| video.ucid = ucid } - videos.each { |video| video.author = author } + videos = extract_videos(nodeset, ucid, author) end count = nodeset.size diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index d62e7ba6..574f1184 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -179,8 +179,8 @@ def html_to_content(description_html) return description_html, description end -def extract_videos(nodeset, ucid = nil) - videos = extract_items(nodeset, ucid) +def extract_videos(nodeset, ucid = nil, author_name = nil) + videos = extract_items(nodeset, ucid, author_name) videos.select! { |item| !item.is_a?(SearchChannel | SearchPlaylist) } videos.map { |video| video.as(SearchVideo) } end |
