From 1432827bf4c98aed3aaa293227695cc1f75ca84a Mon Sep 17 00:00:00 2001 From: syeopite Date: Fri, 8 Nov 2024 16:38:03 -0800 Subject: [PATCH] Fix Ameba warnings --- src/invidious/routes/images.cr | 4 ++-- src/invidious/videos/chapters.cr | 2 +- src/invidious/videos/parser.cr | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/invidious/routes/images.cr b/src/invidious/routes/images.cr index 2d51c6b6..bfb40d00 100644 --- a/src/invidious/routes/images.cr +++ b/src/invidious/routes/images.cr @@ -108,8 +108,8 @@ module Invidious::Routes::Images # Some thumbnails such as the ones for chapters requires some additional queries. query_params = HTTP::Params.new - {"sqp", "rs"}.each do |name| - query_params[name] = env.params.query[name] if env.params.query[name]? + {"sqp", "rs"}.each do |attest_param| + query_params[attest_param] = env.params.query[attest_param] if env.params.query[attest_param]? end headers = HTTP::Headers.new diff --git a/src/invidious/videos/chapters.cr b/src/invidious/videos/chapters.cr index 4d18299f..b2c75ed3 100644 --- a/src/invidious/videos/chapters.cr +++ b/src/invidious/videos/chapters.cr @@ -57,7 +57,7 @@ module Invidious::Videos # Converts the sequence of chapters to a WebVTT representation def to_vtt - vtt = WebVTT.build do |build| + return WebVTT.build do |build| self.each do |chapter| build.cue(chapter.start_ms, chapter.end_ms, chapter.title) end diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index 48cc889f..ed452535 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -275,10 +275,6 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any # If nothing was found previously, fall back to end screen renderer if related.empty? # Container for "endScreenVideoRenderer" items - end_screen_watch_next_array = player_overlays.try &.dig?( - "endScreen", "watchNextEndScreenRenderer", "results" - ) - player_overlays.try &.as_a.each do |element| if item = element["endScreenVideoRenderer"]? related_video = parse_related_video(item)