mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-24 08:51:00 +00:00
Update Song with correct MP3 metadata
This commit fixes an issue where the title/artist information of uploaded files isn't accurate when uploading mp3s. The MP3Stat module seems to parse the mp3 correctly, but doesn't update the `artist` and `title` when updating the `duration`, so in some cases the information saved in the database for a song (and displayed in the UI) will be incorrect or poorly formatted
This commit is contained in:
parent
bb8f14cfe1
commit
8285063823
1 changed files with 2 additions and 0 deletions
|
@ -50,6 +50,8 @@ defmodule LiveBeats.MediaLibrary.Song do
|
|||
changeset
|
||||
|> put_duration(stat.duration)
|
||||
|> Ecto.Changeset.put_change(:mp3_filesize, stat.size)
|
||||
|> Ecto.Changeset.put_change(:artist, stat.artist)
|
||||
|> Ecto.Changeset.put_change(:title, stat.title)
|
||||
end
|
||||
|
||||
defp put_duration(%Ecto.Changeset{} = changeset, duration) when is_integer(duration) do
|
||||
|
|
Loading…
Reference in a new issue