summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsyeopite <syeopite@syeopite.dev>2024-07-17 12:39:40 -0700
committersyeopite <syeopite@syeopite.dev>2024-07-17 12:39:40 -0700
commitfad0a4f52d7c9b2f9310c1c52156560ddd3f36a3 (patch)
treebfb7794e52c50fb3a8dd44bdb7775035e918fe06 /src
parentbad92093bff66bfb0281e5276fa0e136a61ba330 (diff)
downloadinvidious-fad0a4f52d7c9b2f9310c1c52156560ddd3f36a3.tar.gz
invidious-fad0a4f52d7c9b2f9310c1c52156560ddd3f36a3.tar.bz2
invidious-fad0a4f52d7c9b2f9310c1c52156560ddd3f36a3.zip
Ameba: Fix Lint/UselessAssign
Diffstat (limited to 'src')
-rw-r--r--src/invidious/channels/channels.cr2
-rw-r--r--src/invidious/frontend/misc.cr4
-rw-r--r--src/invidious/helpers/handlers.cr2
-rw-r--r--src/invidious/user/imports.cr2
-rw-r--r--src/invidious/videos.cr4
-rw-r--r--src/invidious/yt_backend/connection_pool.cr2
-rw-r--r--src/invidious/yt_backend/extractors.cr1
-rw-r--r--src/invidious/yt_backend/extractors_utils.cr2
8 files changed, 7 insertions, 12 deletions
diff --git a/src/invidious/channels/channels.cr b/src/invidious/channels/channels.cr
index be739673..29546e38 100644
--- a/src/invidious/channels/channels.cr
+++ b/src/invidious/channels/channels.cr
@@ -232,7 +232,7 @@ def fetch_channel(ucid, pull_all_videos : Bool)
id: video_id,
title: title,
published: published,
- updated: Time.utc,
+ updated: updated,
ucid: ucid,
author: author,
length_seconds: length_seconds,
diff --git a/src/invidious/frontend/misc.cr b/src/invidious/frontend/misc.cr
index 43ba9f5c..7a6cf79d 100644
--- a/src/invidious/frontend/misc.cr
+++ b/src/invidious/frontend/misc.cr
@@ -6,9 +6,9 @@ module Invidious::Frontend::Misc
if prefs.automatic_instance_redirect
current_page = env.get?("current_page").as(String)
- redirect_url = "/redirect?referer=#{current_page}"
+ return "/redirect?referer=#{current_page}"
else
- redirect_url = "https://redirect.invidious.io#{env.request.resource}"
+ return "https://redirect.invidious.io#{env.request.resource}"
end
end
end
diff --git a/src/invidious/helpers/handlers.cr b/src/invidious/helpers/handlers.cr
index 174f620d..f3e3b951 100644
--- a/src/invidious/helpers/handlers.cr
+++ b/src/invidious/helpers/handlers.cr
@@ -97,7 +97,7 @@ class AuthHandler < Kemal::Handler
if token = env.request.headers["Authorization"]?
token = JSON.parse(URI.decode_www_form(token.lchop("Bearer ")))
session = URI.decode_www_form(token["session"].as_s)
- scopes, expire, signature = validate_request(token, session, env.request, HMAC_KEY, nil)
+ scopes, _, _ = validate_request(token, session, env.request, HMAC_KEY, nil)
if email = Invidious::Database::SessionIDs.select_email(session)
user = Invidious::Database::Users.select!(email: email)
diff --git a/src/invidious/user/imports.cr b/src/invidious/user/imports.cr
index 108f2ccc..4a3e1259 100644
--- a/src/invidious/user/imports.cr
+++ b/src/invidious/user/imports.cr
@@ -124,7 +124,7 @@ struct Invidious::User
playlist = create_playlist(title, privacy, user)
Invidious::Database::Playlists.update_description(playlist.id, description)
- videos = item["videos"]?.try &.as_a?.try &.each_with_index do |video_id, idx|
+ item["videos"]?.try &.as_a?.try &.each_with_index do |video_id, idx|
if idx > CONFIG.playlist_length_limit
raise InfoException.new("Playlist cannot have more than #{CONFIG.playlist_length_limit} videos")
end
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr
index c218b4ef..9a357376 100644
--- a/src/invidious/videos.cr
+++ b/src/invidious/videos.cr
@@ -394,10 +394,6 @@ end
def fetch_video(id, region)
info = extract_video_info(video_id: id)
- allowed_regions = info
- .dig?("microformat", "playerMicroformatRenderer", "availableCountries")
- .try &.as_a.map &.as_s || [] of String
-
if reason = info["reason"]?
if reason == "Video unavailable"
raise NotFoundException.new(reason.as_s || "")
diff --git a/src/invidious/yt_backend/connection_pool.cr b/src/invidious/yt_backend/connection_pool.cr
index d3dbcc0e..c0356c59 100644
--- a/src/invidious/yt_backend/connection_pool.cr
+++ b/src/invidious/yt_backend/connection_pool.cr
@@ -24,7 +24,7 @@ struct YoutubeConnectionPool
@pool = build_pool()
end
- def client(&block)
+ def client(&)
conn = pool.checkout
begin
response = yield conn
diff --git a/src/invidious/yt_backend/extractors.cr b/src/invidious/yt_backend/extractors.cr
index 0e72957e..0f4f59b8 100644
--- a/src/invidious/yt_backend/extractors.cr
+++ b/src/invidious/yt_backend/extractors.cr
@@ -109,7 +109,6 @@ private module Parsers
end
live_now = false
- paid = false
premium = false
premiere_timestamp = item_contents.dig?("upcomingEventData", "startTime").try { |t| Time.unix(t.as_s.to_i64) }
diff --git a/src/invidious/yt_backend/extractors_utils.cr b/src/invidious/yt_backend/extractors_utils.cr
index 11d95958..c83a2de5 100644
--- a/src/invidious/yt_backend/extractors_utils.cr
+++ b/src/invidious/yt_backend/extractors_utils.cr
@@ -83,5 +83,5 @@ end
def extract_selected_tab(tabs)
# Extract the selected tab from the array of tabs Youtube returns
- return selected_target = tabs.as_a.select(&.["tabRenderer"]?.try &.["selected"]?.try &.as_bool)[0]["tabRenderer"]
+ return tabs.as_a.select(&.["tabRenderer"]?.try &.["selected"]?.try &.as_bool)[0]["tabRenderer"]
end