Download cutoff date for sources (#69)
* Added new uploaded_at column to media items * Updated indexer to pull upload date * Updates media item creation to update on conflict * Added download cutoff date to sources * Applies cutoff date logic to pending media logic * Updated docs
This commit is contained in:
@@ -115,6 +115,12 @@ defmodule Pinchflat.SourcesTest do
|
||||
assert {:error, %Ecto.Changeset{}} = Sources.create_source(@invalid_source_attrs)
|
||||
end
|
||||
|
||||
test "creation with invalid data fails fast and does not call the runner" do
|
||||
expect(YtDlpRunnerMock, :run, 0, &channel_mock/3)
|
||||
|
||||
assert {:error, %Ecto.Changeset{}} = Sources.create_source(@invalid_source_attrs)
|
||||
end
|
||||
|
||||
test "creation enforces uniqueness of collection_id scoped to the media_profile" do
|
||||
expect(YtDlpRunnerMock, :run, 2, fn _url, _opts, _ot ->
|
||||
{:ok,
|
||||
@@ -225,6 +231,14 @@ defmodule Pinchflat.SourcesTest do
|
||||
assert source.collection_name == "some updated name"
|
||||
end
|
||||
|
||||
test "updates with invalid data fails fast and does not call the runner" do
|
||||
expect(YtDlpRunnerMock, :run, 0, &channel_mock/3)
|
||||
|
||||
source = source_fixture()
|
||||
|
||||
assert {:error, %Ecto.Changeset{}} = Sources.update_source(source, @invalid_source_attrs)
|
||||
end
|
||||
|
||||
test "updating the original_url will re-fetch the source details for channels" do
|
||||
expect(YtDlpRunnerMock, :run, &channel_mock/3)
|
||||
|
||||
@@ -430,7 +444,7 @@ defmodule Pinchflat.SourcesTest do
|
||||
end
|
||||
end
|
||||
|
||||
describe "change_source/2" do
|
||||
describe "change_source/3" do
|
||||
test "it returns a changeset" do
|
||||
source = source_fixture()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user