Skip to content

Commit

Permalink
Renamed what looks like the last of the outstanding data
Browse files Browse the repository at this point in the history
  • Loading branch information
kieraneglin committed Feb 2, 2024
1 parent 6a31d33 commit d63135a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/pinchflat/media_source.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions lib/pinchflat/media_source/source.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Pinchflat.MediaSource.Source do
@moduledoc """
The Channel schema.
The Source schema.
"""

use Ecto.Schema
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/pinchflat/tasks/source_tasks.ex
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/pinchflat/workers/media_indexing_worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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_.
Expand Down
6 changes: 3 additions & 3 deletions test/support/fixtures/media_source_fixtures.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)}",
Expand All @@ -26,6 +26,6 @@ defmodule Pinchflat.MediaSourceFixtures do
)
|> Repo.insert()

channel
source
end
end

0 comments on commit d63135a

Please sign in to comment.