mirror of
https://github.com/iv-org/invidious.git
synced 2026-01-28 15:58:30 -06:00
Fix Style/RedundantNilInControlExpression type of Ameba issues
This commit is contained in:
parent
d371829477
commit
3a68d5aeb2
@ -149,7 +149,7 @@ struct Video
|
||||
|
||||
def dash_manifest_url : String?
|
||||
raw_dash_url = info.dig?("streamingData", "dashManifestUrl").try &.as_s
|
||||
return nil if raw_dash_url.nil?
|
||||
return if raw_dash_url.nil?
|
||||
|
||||
# Use manifest v5 parameter to reduce file size
|
||||
# See https://github.com/iv-org/invidious/issues/4186
|
||||
|
||||
@ -7,7 +7,7 @@ require "json"
|
||||
# TODO: "compactRadioRenderer" (Mix) and
|
||||
# TODO: Use a proper struct/class instead of a hacky JSON object
|
||||
def parse_related_video(related : JSON::Any) : Hash(String, JSON::Any)?
|
||||
return nil if !related["videoId"]?
|
||||
return if !related["videoId"]?
|
||||
|
||||
# The compact renderer has video length in seconds, where the end
|
||||
# screen rendered has a full text version ("42:40")
|
||||
@ -57,7 +57,7 @@ def extract_video_info(video_id : String)
|
||||
player_response = YoutubeAPI.player(video_id: video_id)
|
||||
|
||||
if player_response.nil?
|
||||
return nil
|
||||
return
|
||||
end
|
||||
|
||||
playability_status = player_response.dig?("playabilityStatus", "status").try &.as_s
|
||||
@ -147,7 +147,7 @@ def try_fetch_streaming_data(id : String, client_config : YoutubeAPI::ClientConf
|
||||
elsif playability_status == "OK"
|
||||
return response
|
||||
else
|
||||
return nil
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
# another nil will be returned.
|
||||
def extract_text(item : JSON::Any?) : String?
|
||||
if item.nil?
|
||||
return nil
|
||||
return
|
||||
end
|
||||
|
||||
if text_container = item["simpleText"]?
|
||||
|
||||
@ -46,7 +46,7 @@ module UrlSanitizer
|
||||
when "results", "search"
|
||||
return :search
|
||||
else # hashtag, post, trending, brand URLs, etc..
|
||||
return nil
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -463,7 +463,7 @@ module YoutubeAPI
|
||||
if CONFIG.invidious_companion.present?
|
||||
return _post_invidious_companion("/youtubei/v1/player", data)
|
||||
else
|
||||
return nil
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user