diff --git a/lib/pinchflat/media_source.ex b/lib/pinchflat/media_source.ex index 2391036..88dddd7 100644 --- a/lib/pinchflat/media_source.ex +++ b/lib/pinchflat/media_source.ex @@ -22,7 +22,7 @@ defmodule Pinchflat.MediaSource do @doc """ 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) diff --git a/lib/pinchflat/media_source/source.ex b/lib/pinchflat/media_source/source.ex index 1609fc0..b633bf8 100644 --- a/lib/pinchflat/media_source/source.ex +++ b/lib/pinchflat/media_source/source.ex @@ -1,6 +1,6 @@ defmodule Pinchflat.MediaSource.Source do @moduledoc """ - The Channel schema. + The Source schema. """ use Ecto.Schema @@ -18,7 +18,7 @@ defmodule Pinchflat.MediaSource.Source do field :collection_type, Ecto.Enum, values: [:channel, :playlist] field :index_frequency_minutes, :integer # 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 belongs_to :media_profile, MediaProfile diff --git a/lib/pinchflat/tasks/source_tasks.ex b/lib/pinchflat/tasks/source_tasks.ex index b28bc07..0d5aa08 100644 --- a/lib/pinchflat/tasks/source_tasks.ex +++ b/lib/pinchflat/tasks/source_tasks.ex @@ -1,6 +1,6 @@ defmodule Pinchflat.Tasks.SourceTasks do @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 diff --git a/lib/pinchflat/workers/media_indexing_worker.ex b/lib/pinchflat/workers/media_indexing_worker.ex index 9ee5d6b..166a4bd 100644 --- a/lib/pinchflat/workers/media_indexing_worker.ex +++ b/lib/pinchflat/workers/media_indexing_worker.ex @@ -14,10 +14,10 @@ defmodule Pinchflat.Workers.MediaIndexingWorker do @impl Oban.Worker @doc """ - The ID is that of a channel _record_, not a YouTube channel ID. Indexes - the provided channel, kicks off downloads for each new MediaItem, and + The ID is that of a source _record_, not a YouTube channel/playlist ID. Indexes + the provided source, kicks off downloads for each new MediaItem, and 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. The reschedule time is relative to the time the job has actually _completed_. diff --git a/test/support/fixtures/media_source_fixtures.ex b/test/support/fixtures/media_source_fixtures.ex index 2cebd7a..178ccc9 100644 --- a/test/support/fixtures/media_source_fixtures.ex +++ b/test/support/fixtures/media_source_fixtures.ex @@ -12,11 +12,11 @@ defmodule Pinchflat.MediaSourceFixtures do Generate a source. """ def source_fixture(attrs \\ %{}) do - {:ok, channel} = + {:ok, source} = %Source{} |> Source.changeset( 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_type: "channel", original_url: "https://www.youtube.com/channel/#{Faker.String.base64(12)}", @@ -26,6 +26,6 @@ defmodule Pinchflat.MediaSourceFixtures do ) |> Repo.insert() - channel + source end end