From 2630dc8dcd5d1460b395406eead144dd04cd7ba0 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 4 Feb 2019 15:28:51 -0600 Subject: [PATCH] Add 'related_videos' to video params --- src/invidious/videos.cr | 5 +++++ src/invidious/views/watch.ecr | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index a95f5443..21c87edf 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -725,6 +725,7 @@ end def process_video_params(query, preferences) autoplay = query["autoplay"]?.try &.to_i? continue = query["continue"]?.try &.to_i? + related_videos = query["related_videos"]? listen = query["listen"]? && (query["listen"] == "true" || query["listen"] == "1").to_unsafe preferred_captions = query["subtitles"]?.try &.split(",").map { |a| a.downcase } quality = query["quality"]? @@ -737,6 +738,7 @@ def process_video_params(query, preferences) # region ||= preferences.region autoplay ||= preferences.autoplay.to_unsafe continue ||= preferences.continue.to_unsafe + related_videos ||= preferences.related_videos.to_unsafe listen ||= preferences.listen.to_unsafe preferred_captions ||= preferences.captions quality ||= preferences.quality @@ -747,6 +749,7 @@ def process_video_params(query, preferences) autoplay ||= DEFAULT_USER_PREFERENCES.autoplay.to_unsafe continue ||= DEFAULT_USER_PREFERENCES.continue.to_unsafe + related_videos ||= DEFAULT_USER_PREFERENCES.related_videos.to_unsafe listen ||= DEFAULT_USER_PREFERENCES.listen.to_unsafe preferred_captions ||= DEFAULT_USER_PREFERENCES.captions quality ||= DEFAULT_USER_PREFERENCES.quality @@ -756,6 +759,7 @@ def process_video_params(query, preferences) autoplay = autoplay == 1 continue = continue == 1 + related_videos = related_videos == 1 listen = listen == 1 video_loop = video_loop == 1 @@ -793,6 +797,7 @@ def process_video_params(query, preferences) quality: quality, raw: raw, region: region, + related_videos: related_videos, speed: speed, video_end: video_end, video_loop: video_loop, diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index a8f98492..7ba5ae7f 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -110,7 +110,7 @@ -
+
- <% if !preferences || preferences && preferences.related_videos || plid %> + <% if params[:related_videos] || plid %>
<% if plid %>
<% end %> - <% if !preferences || preferences && preferences.related_videos %> + <% if params[:related_videos] %>
<% if !rvs.empty? %>