mirror of
https://github.com/iv-org/invidious.git
synced 2026-01-28 15:58:30 -06:00
Fix Lint/ElseNil type of Ameba issues
This commit is contained in:
parent
2112ee674e
commit
a6ade56756
@ -137,7 +137,6 @@ module Invidious::Frontend::Comments
|
|||||||
<div id="skip-#{child["commentId"]}"></div>
|
<div id="skip-#{child["commentId"]}"></div>
|
||||||
</section>
|
</section>
|
||||||
END_HTML
|
END_HTML
|
||||||
else nil # Ignore
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -108,7 +108,6 @@ def decode_date(string : String)
|
|||||||
return Time.utc
|
return Time.utc
|
||||||
when "yesterday"
|
when "yesterday"
|
||||||
return Time.utc - 1.day
|
return Time.utc - 1.day
|
||||||
else nil # Continue
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# String matches format "20 hours ago", "4 months ago", "20s ago", "15min ago"...
|
# String matches format "20 hours ago", "4 months ago", "20s ago", "15min ago"...
|
||||||
|
|||||||
@ -119,7 +119,6 @@ module Invidious::Routes::Embed
|
|||||||
end
|
end
|
||||||
|
|
||||||
return env.redirect url
|
return env.redirect url
|
||||||
else nil # Continue
|
|
||||||
end
|
end
|
||||||
|
|
||||||
params = process_video_params(env.params.query, preferences)
|
params = process_video_params(env.params.query, preferences)
|
||||||
|
|||||||
@ -322,7 +322,6 @@ module Invidious::Routes::Feeds
|
|||||||
request_target = URI.parse(node[attribute.name]).request_target
|
request_target = URI.parse(node[attribute.name]).request_target
|
||||||
query_string_opt = request_target.starts_with?("/watch?v=") ? "&#{params}" : ""
|
query_string_opt = request_target.starts_with?("/watch?v=") ? "&#{params}" : ""
|
||||||
node[attribute.name] = "#{HOST_URL}#{request_target}#{query_string_opt}"
|
node[attribute.name] = "#{HOST_URL}#{request_target}#{query_string_opt}"
|
||||||
else nil # Skip
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -347,7 +347,6 @@ module Invidious::Routes::PreferencesRoute
|
|||||||
response: error_template(415, "Uploaded file is too large")
|
response: error_template(415, "Uploaded file is too large")
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
else nil # Ignore
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -45,7 +45,6 @@ def get_subscription_feed(user, max_results = 40, page = 1)
|
|||||||
notifications.sort_by!(&.author)
|
notifications.sort_by!(&.author)
|
||||||
when "channel name - reverse"
|
when "channel name - reverse"
|
||||||
notifications.sort_by!(&.author).reverse!
|
notifications.sort_by!(&.author).reverse!
|
||||||
else nil # Ignore
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if user.preferences.latest_only
|
if user.preferences.latest_only
|
||||||
@ -94,7 +93,6 @@ def get_subscription_feed(user, max_results = 40, page = 1)
|
|||||||
videos.sort_by!(&.author)
|
videos.sort_by!(&.author)
|
||||||
when "channel name - reverse"
|
when "channel name - reverse"
|
||||||
videos.sort_by!(&.author).reverse!
|
videos.sort_by!(&.author).reverse!
|
||||||
else nil # Ignore
|
|
||||||
end
|
end
|
||||||
|
|
||||||
notifications = Invidious::Database::Users.select_notifications(user)
|
notifications = Invidious::Database::Users.select_notifications(user)
|
||||||
|
|||||||
@ -152,7 +152,6 @@ private module Parsers
|
|||||||
when "Premium"
|
when "Premium"
|
||||||
# TODO: Potentially available as item_contents["topStandaloneBadge"]["metadataBadgeRenderer"]
|
# TODO: Potentially available as item_contents["topStandaloneBadge"]["metadataBadgeRenderer"]
|
||||||
badges |= VideoBadges::Premium
|
badges |= VideoBadges::Premium
|
||||||
else nil # Ignore
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -24,8 +24,6 @@ def extract_text(item : JSON::Any?) : String?
|
|||||||
return text_container.as_s
|
return text_container.as_s
|
||||||
elsif text_container = item["runs"]?
|
elsif text_container = item["runs"]?
|
||||||
return text_container.as_a.map(&.["text"].as_s).join("")
|
return text_container.as_a.map(&.["text"].as_s).join("")
|
||||||
else
|
|
||||||
nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user