Fix Lint/ElseNil type of Ameba issues

This commit is contained in:
Sijawusz Pur Rahnama 2026-01-11 22:53:10 +01:00
parent 2112ee674e
commit a6ade56756
8 changed files with 0 additions and 10 deletions

View File

@ -137,7 +137,6 @@ module Invidious::Frontend::Comments
<div id="skip-#{child["commentId"]}"></div>
</section>
END_HTML
else nil # Ignore
end
end

View File

@ -108,7 +108,6 @@ def decode_date(string : String)
return Time.utc
when "yesterday"
return Time.utc - 1.day
else nil # Continue
end
# String matches format "20 hours ago", "4 months ago", "20s ago", "15min ago"...

View File

@ -119,7 +119,6 @@ module Invidious::Routes::Embed
end
return env.redirect url
else nil # Continue
end
params = process_video_params(env.params.query, preferences)

View File

@ -322,7 +322,6 @@ module Invidious::Routes::Feeds
request_target = URI.parse(node[attribute.name]).request_target
query_string_opt = request_target.starts_with?("/watch?v=") ? "&#{params}" : ""
node[attribute.name] = "#{HOST_URL}#{request_target}#{query_string_opt}"
else nil # Skip
end
end
end

View File

@ -347,7 +347,6 @@ module Invidious::Routes::PreferencesRoute
response: error_template(415, "Uploaded file is too large")
)
end
else nil # Ignore
end
end
end

View File

@ -45,7 +45,6 @@ def get_subscription_feed(user, max_results = 40, page = 1)
notifications.sort_by!(&.author)
when "channel name - reverse"
notifications.sort_by!(&.author).reverse!
else nil # Ignore
end
else
if user.preferences.latest_only
@ -94,7 +93,6 @@ def get_subscription_feed(user, max_results = 40, page = 1)
videos.sort_by!(&.author)
when "channel name - reverse"
videos.sort_by!(&.author).reverse!
else nil # Ignore
end
notifications = Invidious::Database::Users.select_notifications(user)

View File

@ -152,7 +152,6 @@ private module Parsers
when "Premium"
# TODO: Potentially available as item_contents["topStandaloneBadge"]["metadataBadgeRenderer"]
badges |= VideoBadges::Premium
else nil # Ignore
end
end

View File

@ -24,8 +24,6 @@ def extract_text(item : JSON::Any?) : String?
return text_container.as_s
elsif text_container = item["runs"]?
return text_container.as_a.map(&.["text"].as_s).join("")
else
nil
end
end