Skip to content

Commit b9f761f

Browse files
committed
Revert "upload manifest with correct s3 paths"
This reverts commit 04eb312.
1 parent 04eb312 commit b9f761f

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

lib/ex_webrtc_recorder/s3/upload_handler.ex

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ if Code.ensure_loaded?(ExAws.S3) do
4949
{id, s3_path}
5050
end)
5151

52-
download_manifest = prepare_download_manifest(files_to_upload, bucket_name, s3_paths)
52+
download_manifest =
53+
Map.new(files_to_upload, fn {id, object_data} ->
54+
{:ok, location} = Recorder.S3.Utils.to_url(bucket_name, s3_paths[id])
55+
56+
{id, %{object_data | location: location}}
57+
end)
58+
5359
# FIXME: this links, ideally we should use `async_nolink` instead
5460
# but this may require a slight change of the current UploadHandler logic
5561
task =
@@ -112,23 +118,6 @@ if Code.ensure_loaded?(ExAws.S3) do
112118
{id, result}
113119
end)
114120
end
115-
116-
defp prepare_download_manifest(files_to_upload, bucket_name, s3_paths) do
117-
{manifest_file, track_files} = Map.pop(files_to_upload, "manifest_file")
118-
119-
download_manifest =
120-
Map.new(track_files, fn {id, object_data} ->
121-
{:ok, location} = Recorder.S3.Utils.to_url(bucket_name, s3_paths[id])
122-
{id, %{object_data | location: location}}
123-
end)
124-
125-
# Update the local manifest file to contain S3 URLs instead of local paths
126-
if manifest_file do
127-
:ok = File.write!(manifest_file.location, Jason.encode!(download_manifest))
128-
end
129-
130-
download_manifest
131-
end
132121
end
133122
else
134123
defmodule ExWebRTC.Recorder.S3.UploadHandler do

0 commit comments

Comments
 (0)