mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
search.cr: use do/end rather than inline {} block
This commit is contained in:
parent
63e1165936
commit
6f4665588f
2 changed files with 5 additions and 6 deletions
|
@ -27,10 +27,9 @@ def channel_search(query, page, channel) : Array(SearchItem)
|
|||
return [] of SearchItem if !continuation_items
|
||||
|
||||
items = [] of SearchItem
|
||||
continuation_items.as_a.select(&.as_h.has_key?("itemSectionRenderer")).each { |item|
|
||||
extract_item(item["itemSectionRenderer"]["contents"].as_a[0])
|
||||
.try { |t| items << t }
|
||||
}
|
||||
continuation_items.as_a.select(&.as_h.has_key?("itemSectionRenderer")).each do |item|
|
||||
extract_item(item["itemSectionRenderer"]["contents"].as_a[0]).try { |t| items << t }
|
||||
end
|
||||
|
||||
return items
|
||||
end
|
||||
|
|
|
@ -687,7 +687,7 @@ struct Video
|
|||
end
|
||||
|
||||
def paid
|
||||
reason = info.dig?("playabilityStatus", "reason") || ""
|
||||
reason = info.dig?("playabilityStatus", "reason").try &.as_s || ""
|
||||
return reason.includes? "requires payment"
|
||||
end
|
||||
|
||||
|
@ -712,7 +712,7 @@ struct Video
|
|||
end
|
||||
|
||||
def description
|
||||
description = info!
|
||||
description = info
|
||||
.dig?("microformat", "playerMicroformatRenderer", "description", "simpleText")
|
||||
.try &.as_s || ""
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue