Use struct for allocations

このコミットが含まれているのは:
Omar Roth 2019-03-29 16:30:02 -05:00
コミット 1b78001201
8個のファイルの変更17行の追加17行の削除

ファイルの表示

@ -1,4 +1,4 @@
class InvidiousChannel struct InvidiousChannel
add_mapping({ add_mapping({
id: String, id: String,
author: String, author: String,
@ -8,7 +8,7 @@ class InvidiousChannel
}) })
end end
class ChannelVideo struct ChannelVideo
add_mapping({ add_mapping({
id: String, id: String,
title: String, title: String,

ファイルの表示

@ -29,7 +29,7 @@ class RedditComment
}) })
end end
class RedditLink struct RedditLink
JSON.mapping({ JSON.mapping({
author: String, author: String,
score: Int32, score: Int32,
@ -41,7 +41,7 @@ class RedditLink
}) })
end end
class RedditMore struct RedditMore
JSON.mapping({ JSON.mapping({
children: Array(String), children: Array(String),
count: Int32, count: Int32,

ファイルの表示

@ -1,4 +1,4 @@
class Config struct Config
YAML.mapping({ YAML.mapping({
channel_threads: Int32, # Number of threads to use for crawling videos from channels (for updating subscriptions) channel_threads: Int32, # Number of threads to use for crawling videos from channels (for updating subscriptions)
feed_threads: Int32, # Number of threads to use for updating feeds feed_threads: Int32, # Number of threads to use for updating feeds

ファイルの表示

@ -1,4 +1,4 @@
class MixVideo struct MixVideo
add_mapping({ add_mapping({
title: String, title: String,
id: String, id: String,
@ -10,7 +10,7 @@ class MixVideo
}) })
end end
class Mix struct Mix
add_mapping({ add_mapping({
title: String, title: String,
id: String, id: String,

ファイルの表示

@ -1,4 +1,4 @@
class PlaylistVideo struct PlaylistVideo
add_mapping({ add_mapping({
title: String, title: String,
id: String, id: String,
@ -12,7 +12,7 @@ class PlaylistVideo
}) })
end end
class Playlist struct Playlist
add_mapping({ add_mapping({
title: String, title: String,
id: String, id: String,

ファイルの表示

@ -1,4 +1,4 @@
class SearchVideo struct SearchVideo
add_mapping({ add_mapping({
title: String, title: String,
id: String, id: String,
@ -16,7 +16,7 @@ class SearchVideo
}) })
end end
class SearchPlaylistVideo struct SearchPlaylistVideo
add_mapping({ add_mapping({
title: String, title: String,
id: String, id: String,
@ -24,7 +24,7 @@ class SearchPlaylistVideo
}) })
end end
class SearchPlaylist struct SearchPlaylist
add_mapping({ add_mapping({
title: String, title: String,
id: String, id: String,
@ -36,7 +36,7 @@ class SearchPlaylist
}) })
end end
class SearchChannel struct SearchChannel
add_mapping({ add_mapping({
author: String, author: String,
ucid: String, ucid: String,

ファイルの表示

@ -1,6 +1,6 @@
require "crypto/bcrypt/password" require "crypto/bcrypt/password"
class User struct User
module PreferencesConverter module PreferencesConverter
def self.from_rs(rs) def self.from_rs(rs)
begin begin

ファイルの表示

@ -241,7 +241,7 @@ VIDEO_FORMATS = {
"251" => {"ext" => "webm", "format" => "DASH audio", "acodec" => "opus", "abr" => 160}, "251" => {"ext" => "webm", "format" => "DASH audio", "acodec" => "opus", "abr" => 160},
} }
class Video struct Video
property player_json : JSON::Any? property player_json : JSON::Any?
module HTTPParamConverter module HTTPParamConverter
@ -549,7 +549,7 @@ class Video
}) })
end end
class Caption struct Caption
JSON.mapping( JSON.mapping(
name: CaptionName, name: CaptionName,
baseUrl: String, baseUrl: String,
@ -557,7 +557,7 @@ class Caption
) )
end end
class CaptionName struct CaptionName
JSON.mapping( JSON.mapping(
simpleText: String, simpleText: String,
) )