Renamed what looks like the last of the outstanding data
This commit is contained in:
parent
6a31d333ad
commit
d63135aa59
5 changed files with 10 additions and 10 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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_.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue