bdef6c75bb
* Ensure channel detail lookup doesn't download the video - oops * Ran the needful migrations for replacing channels with sources * got media source test back working * channel tasks test * Media indexing worker test * media tests * Got all tests working except controller tests * got all tests working * Renamed Channel struct to Source * renamed ChannelTasks * More renaming; renamed channel details module * Removed Channel yt-dlp module, instead throwing things in the VideoCollection module * Renamed what looks like the last of the outstanding data
27 lines
513 B
Elixir
27 lines
513 B
Elixir
defmodule Pinchflat.Tasks.Task do
|
|
@moduledoc """
|
|
The Task schema.
|
|
"""
|
|
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
alias Pinchflat.Media.MediaItem
|
|
alias Pinchflat.MediaSource.Source
|
|
|
|
schema "tasks" do
|
|
belongs_to :job, Oban.Job
|
|
belongs_to :source, Source
|
|
belongs_to :media_item, MediaItem
|
|
|
|
timestamps(type: :utc_datetime)
|
|
end
|
|
|
|
@doc false
|
|
def changeset(task, attrs) do
|
|
task
|
|
|> cast(attrs, [:job_id, :source_id, :media_item_id])
|
|
|> validate_required([:job_id])
|
|
end
|
|
end
|