Skip to content

Commit 6f46655

Browse files
committed
search.cr: use do/end rather than inline {} block
1 parent 63e1165 commit 6f46655

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/invidious/search.cr

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ def channel_search(query, page, channel) : Array(SearchItem)
2727
return [] of SearchItem if !continuation_items
2828

2929
items = [] of SearchItem
30-
continuation_items.as_a.select(&.as_h.has_key?("itemSectionRenderer")).each { |item|
31-
extract_item(item["itemSectionRenderer"]["contents"].as_a[0])
32-
.try { |t| items << t }
33-
}
30+
continuation_items.as_a.select(&.as_h.has_key?("itemSectionRenderer")).each do |item|
31+
extract_item(item["itemSectionRenderer"]["contents"].as_a[0]).try { |t| items << t }
32+
end
3433

3534
return items
3635
end

src/invidious/videos.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ struct Video
687687
end
688688

689689
def paid
690-
reason = info.dig?("playabilityStatus", "reason") || ""
690+
reason = info.dig?("playabilityStatus", "reason").try &.as_s || ""
691691
return reason.includes? "requires payment"
692692
end
693693

@@ -712,7 +712,7 @@ struct Video
712712
end
713713

714714
def description
715-
description = info!
715+
description = info
716716
.dig?("microformat", "playerMicroformatRenderer", "description", "simpleText")
717717
.try &.as_s || ""
718718
end

0 commit comments

Comments
 (0)