Skip to content

Commit 971b6ec

Browse files
committed
Fix 'Lint/UselessAssign' warnings reported by ameba
1 parent 46f7ca9 commit 971b6ec

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/invidious/comments.cr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b
9393
end
9494
contents = body["contents"]?
9595
header = body["header"]?
96-
if body["continuations"]?
97-
# Removable? Doesn't seem like this is used.
98-
more_replies_continuation = body["continuations"][0]["nextContinuationData"]["continuation"].as_s
99-
end
10096
else
10197
raise InfoException.new("Could not fetch comments")
10298
end

src/invidious/playlists.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ def extract_playlist_videos(initial_data : Hash(String, JSON::Any))
463463
plid = i["navigationEndpoint"]["watchEndpoint"]["playlistId"].as_s
464464
index = i["navigationEndpoint"]["watchEndpoint"]["index"].as_i64
465465

466-
thumbnail = i["thumbnail"]["thumbnails"][0]["url"].as_s
467466
title = i["title"].try { |t| t["simpleText"]? || t["runs"]?.try &.[0]["text"]? }.try &.as_s || ""
468467
author = i["shortBylineText"]?.try &.["runs"][0]["text"].as_s || ""
469468
ucid = i["shortBylineText"]?.try &.["runs"][0]["navigationEndpoint"]["browseEndpoint"]["browseId"].as_s || ""

src/invidious/users.cr

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def fetch_user(sid, headers)
6565
feed = YT_POOL.client &.get("/subscription_manager?disable_polymer=1", headers)
6666
feed = XML.parse_html(feed.body)
6767

68-
channels = [] of String
6968
channels = feed.xpath_nodes(%q(//ul[@id="guide-channels"]/li/a)).compact_map do |channel|
7069
if {"Popular on YouTube", "Music", "Sports", "Gaming"}.includes? channel["title"]
7170
nil
@@ -157,12 +156,11 @@ def generate_captcha(key)
157156
</svg>
158157
END_SVG
159158

160-
image = ""
161-
convert = Process.run(%(rsvg-convert -w 400 -h 400 -b none -f png), shell: true,
162-
input: IO::Memory.new(clock_svg), output: Process::Redirect::Pipe) do |proc|
163-
image = proc.output.gets_to_end
164-
image = Base64.strict_encode(image)
165-
image = "data:image/png;base64,#{image}"
159+
image = "data:image/png;base64,"
160+
image += Process.run(%(rsvg-convert -w 400 -h 400 -b none -f png), shell: true,
161+
input: IO::Memory.new(clock_svg), output: Process::Redirect::Pipe
162+
) do |proc|
163+
Base64.strict_encode(proc.output.gets_to_end)
166164
end
167165

168166
answer = "#{hour}:#{minute.to_s.rjust(2, '0')}:#{second.to_s.rjust(2, '0')}"

0 commit comments

Comments
 (0)