Change Channel to Source (#12)

* 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
This commit is contained in:
Kieran authored and GitHub committed 2024-02-02 17:45:21 -08:00
1 parent 977b69b7c3
commit 366fd80213
46 files changed
+805 -762

No files matched your search

+4 -4
View File
@@ -8,7 +8,7 @@ defmodule Pinchflat.Media do
alias Pinchflat.Repo
alias Pinchflat.Tasks
alias Pinchflat.Media.MediaItem
alias Pinchflat.MediaSource.Channel
alias Pinchflat.MediaSource.Source
@doc """
Returns the list of media_items. Returns [%MediaItem{}, ...].
@@ -18,15 +18,15 @@ defmodule Pinchflat.Media do
end
@doc """
Returns a list of pending media_items for a given channel, where
Returns a list of pending media_items for a given source, where
pending means the `media_filepath` is `nil`.
Returns [%MediaItem{}, ...].
"""
def list_pending_media_items_for(%Channel{} = channel) do
def list_pending_media_items_for(%Source{} = source) do
from(
m in MediaItem,
where: m.channel_id == ^channel.id and is_nil(m.media_filepath)
where: m.source_id == ^source.id and is_nil(m.media_filepath)
)
|> Repo.all()
end