Update reduce_uri signature

Following request_change at :
- https://github.com/iv-org/invidious/pull/2936#discussion_r814436660
このコミットが含まれているのは:
Féry Mathieu (Mathius) 2022-02-25 11:47:07 +01:00
コミット 0f1bb3fb3b
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: F9CCC80C18A59037
1個のファイルの変更3行の追加6行の削除

ファイルの表示

@ -366,13 +366,10 @@ def fetch_random_instance
return filtered_instance_list.sample(1)[0]
end
def reduce_uri(uri : URI | String, max_length : Int32? = 50, suffix : String? = "...") : String
def reduce_uri(uri : URI | String, max_length : Int32 = 50, suffix : String = "") : String
str = uri.to_s.sub(/https?:\/\//, "")
if !max_length.nil? && str.size > max_length
str = str[0, max_length]
if !suffix.nil?
str = "#{str}#{suffix}"
end
if str.size > max_length
str = "#{str[0, max_length]}#{suffix}"
end
return str
end