Renamed what looks like the last of the outstanding data

This commit is contained in:
Kieran Eglin 2024-02-02 10:31:30 -08:00
parent 6a31d333ad
commit d63135aa59
No known key found for this signature in database
GPG key ID: 193984967FCF432D
5 changed files with 10 additions and 10 deletions

View file

@ -22,7 +22,7 @@ defmodule Pinchflat.MediaSource do
@doc """ @doc """
Gets a single source. Gets a single source.
Returns %Source{}. Raises `Ecto.NoResultsError` if the Channel does not exist. Returns %Source{}. Raises `Ecto.NoResultsError` if the Source does not exist.
""" """
def get_source!(id), do: Repo.get!(Source, id) def get_source!(id), do: Repo.get!(Source, id)

View file

@ -1,6 +1,6 @@
defmodule Pinchflat.MediaSource.Source do defmodule Pinchflat.MediaSource.Source do
@moduledoc """ @moduledoc """
The Channel schema. The Source schema.
""" """
use Ecto.Schema use Ecto.Schema
@ -18,7 +18,7 @@ defmodule Pinchflat.MediaSource.Source do
field :collection_type, Ecto.Enum, values: [:channel, :playlist] field :collection_type, Ecto.Enum, values: [:channel, :playlist]
field :index_frequency_minutes, :integer field :index_frequency_minutes, :integer
# This should only be used for user reference going forward # This should only be used for user reference going forward
# as the channel_id should be used for all API calls # as the collection_id should be used for all API calls
field :original_url, :string field :original_url, :string
belongs_to :media_profile, MediaProfile belongs_to :media_profile, MediaProfile

View file

@ -1,6 +1,6 @@
defmodule Pinchflat.Tasks.SourceTasks do defmodule Pinchflat.Tasks.SourceTasks do
@moduledoc """ @moduledoc """
This module contains methods for managing tasks (workers) related to channels. This module contains methods for managing tasks (workers) related to sources.
""" """
alias Pinchflat.Tasks alias Pinchflat.Tasks

View file

@ -14,10 +14,10 @@ defmodule Pinchflat.Workers.MediaIndexingWorker do
@impl Oban.Worker @impl Oban.Worker
@doc """ @doc """
The ID is that of a channel _record_, not a YouTube channel ID. Indexes The ID is that of a source _record_, not a YouTube channel/playlist ID. Indexes
the provided channel, kicks off downloads for each new MediaItem, and the provided source, kicks off downloads for each new MediaItem, and
reschedules the job to run again in the future (as determined by the reschedules the job to run again in the future (as determined by the
channel's `index_frequency_minutes` field). souce's `index_frequency_minutes` field).
README: Re-scheduling here works a little different than you may expect. README: Re-scheduling here works a little different than you may expect.
The reschedule time is relative to the time the job has actually _completed_. The reschedule time is relative to the time the job has actually _completed_.

View file

@ -12,11 +12,11 @@ defmodule Pinchflat.MediaSourceFixtures do
Generate a source. Generate a source.
""" """
def source_fixture(attrs \\ %{}) do def source_fixture(attrs \\ %{}) do
{:ok, channel} = {:ok, source} =
%Source{} %Source{}
|> Source.changeset( |> Source.changeset(
Enum.into(attrs, %{ Enum.into(attrs, %{
name: "Channel ##{:rand.uniform(1_000_000)}", name: "Source ##{:rand.uniform(1_000_000)}",
collection_id: Base.encode16(:crypto.hash(:md5, "#{:rand.uniform(1_000_000)}")), collection_id: Base.encode16(:crypto.hash(:md5, "#{:rand.uniform(1_000_000)}")),
collection_type: "channel", collection_type: "channel",
original_url: "https://www.youtube.com/channel/#{Faker.String.base64(12)}", original_url: "https://www.youtube.com/channel/#{Faker.String.base64(12)}",
@ -26,6 +26,6 @@ defmodule Pinchflat.MediaSourceFixtures do
) )
|> Repo.insert() |> Repo.insert()
channel source
end end
end end