1
0
mirror of https://github.com/algora-io/tv.git synced 2025-03-17 20:17:45 +02:00
algora-tv/lib/algora/library/subtitle.ex

22 lines
424 B
Elixir
Raw Normal View History

defmodule Algora.Library.Subtitle do
alias Algora.Library
use Ecto.Schema
import Ecto.Changeset
schema "subtitles" do
field :start, :float
field :end, :float
field :body, :string
belongs_to :video, Library.Video
timestamps()
end
@doc false
def changeset(subtitle, attrs) do
subtitle
|> cast(attrs, [:body, :start, :end])
|> validate_required([:body, :start, :end])
end
end