aboutsummaryrefslogtreecommitdiff
path: root/web/controllers
diff options
context:
space:
mode:
authorVincent Jousse <vincent@jousse.org>2017-01-25 12:53:42 +0100
committerVincent Jousse <vincent@jousse.org>2017-01-25 14:44:11 +0100
commit532c3a6538d3cc5916cb5bafeaab931164089e20 (patch)
tree4328c2f91339c1f9a688f211c1dfd36facef4c0e /web/controllers
parent6565363f129f2c4a82e2ff0b9c73d7dd4f27360e (diff)
downloadthe_transcriber_backend-532c3a6538d3cc5916cb5bafeaab931164089e20.tar.xz
the_transcriber_backend-532c3a6538d3cc5916cb5bafeaab931164089e20.zip
Quick fix for the upload to work
Diffstat (limited to '')
-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