aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/controllers/audio_file_controller.ex9
1 files changed, 7 insertions, 2 deletions
diff --git a/web/controllers/audio_file_controller.ex b/web/controllers/audio_file_controller.ex
index 630e0fe..c32a7f8 100644
--- a/web/controllers/audio_file_controller.ex
+++ b/web/controllers/audio_file_controller.ex
@@ -19,8 +19,13 @@ defmodule TheTranscriberBackend.AudioFileController do
path = "/media/phoenix_test/#{upload.filename}"
File.cp(upload.path, path)
end
- changeset = AudioFile.changeset(%AudioFile{}, audio_file_params)
- |> Ecto.Changeset.put_change(:audio_path, path)
+
+ # "Non-elixir" way of doing things
+ changeset = AudioFile.changeset(%AudioFile{},
+ %{audio_path: path,
+ transcription_file_path: audio_file_params["transcription_file_path"],
+ audio_duration: audio_file_params["audio_duration"]})
+
IO.inspect changeset
case Repo.insert(changeset) do