Skip to content

Commit 0edf793

Browse files
committed
apply comment suggestions
1 parent c733abf commit 0edf793

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

lib/ex_webrtc_recorder/s3.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ defmodule ExWebRTC.Recorder.S3 do
2424
2525
* `:bucket_name` (required) - Name of bucket objects will be uploaded to.
2626
* `:base_path` - S3 path prefix used for objects uploaded to the bucket. `""` by default.
27+
* `:upload_manifest` - Whether to upload the manifest file. Defaults to `true`.
2728
"""
2829
@type upload_option ::
2930
{:bucket_name, String.t()} | {:base_path, String.t()} | {:upload_manifest, boolean()}

lib/ex_webrtc_recorder/s3/upload_handler.ex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ if Code.ensure_loaded?(ExAws.S3) do
1515
bucket_name: String.t(),
1616
base_path: Path.t(),
1717
tasks: %{ref() => manifest()},
18-
upload_manifest: boolean()
18+
upload_manifest?: boolean()
1919
}
2020

21-
@enforce_keys [:s3_config_overrides, :bucket_name, :base_path, :upload_manifest]
21+
@enforce_keys [:s3_config_overrides, :bucket_name, :base_path, :upload_manifest?]
2222
defstruct @enforce_keys ++ [tasks: %{}]
2323

2424
@spec new(keyword()) :: t()
@@ -28,14 +28,14 @@ if Code.ensure_loaded?(ExAws.S3) do
2828

2929
base_path = Keyword.get(config, :base_path, "")
3030
{:ok, _test_path} = base_path |> Path.join("a") |> Recorder.S3.Utils.validate_s3_path()
31-
upload_manifest = Keyword.get(config, :upload_manifest, false)
31+
upload_manifest? = Keyword.get(config, :upload_manifest, true)
3232

3333
s3_config_overrides = Keyword.drop(config, [:bucket_name, :base_path])
3434

3535
%__MODULE__{
3636
bucket_name: bucket_name,
3737
base_path: base_path,
38-
upload_manifest: upload_manifest,
38+
upload_manifest?: upload_manifest?,
3939
s3_config_overrides: s3_config_overrides
4040
}
4141
end
@@ -45,7 +45,7 @@ if Code.ensure_loaded?(ExAws.S3) do
4545
%__MODULE__{
4646
bucket_name: bucket_name,
4747
base_path: base_path,
48-
upload_manifest: upload_manifest,
48+
upload_manifest?: upload_manifest?,
4949
s3_config_overrides: s3_config_overrides
5050
} =
5151
handler,
@@ -71,12 +71,12 @@ if Code.ensure_loaded?(ExAws.S3) do
7171
Task.Supervisor.async(ExWebRTC.Recorder.TaskSupervisor, fn ->
7272
upload(
7373
manifest,
74+
download_manifest,
7475
bucket_name,
7576
base_path,
7677
s3_paths,
7778
s3_config_overrides,
78-
upload_manifest,
79-
download_manifest
79+
upload_manifest?
8080
)
8181
end)
8282

@@ -114,12 +114,12 @@ if Code.ensure_loaded?(ExAws.S3) do
114114

115115
defp upload(
116116
manifest,
117+
download_manifest,
117118
bucket_name,
118119
base_path,
119120
s3_paths,
120121
s3_config_overrides,
121-
upload_manifest,
122-
download_manifest
122+
upload_manifest?
123123
) do
124124
results =
125125
Map.new(manifest, fn {id, %{location: path}} ->
@@ -144,7 +144,7 @@ if Code.ensure_loaded?(ExAws.S3) do
144144
{id, result}
145145
end)
146146

147-
if upload_manifest do
147+
if upload_manifest? do
148148
manifest_s3_path =
149149
Path.join(base_path, "manifest.json")
150150

0 commit comments

Comments
 (0)