[Housekeeping] Pass the current action when calling the yt-dlp runner (#514)

* Updated yt-dlp runner to take an action type

* Added actions to all callers of the yt-dlp runner

* [SQUASH] updated test files to use new mocking strategy

* Removed unneeded alias
This commit is contained in:
Kieran
2024-12-13 12:29:05 -08:00
committed by GitHub
parent e9d365ee9e
commit 023f449dbe
19 changed files with 276 additions and 250 deletions
+3 -3
View File
@@ -757,7 +757,7 @@ defmodule Pinchflat.MediaTest do
end
test "does delete the media item's metadata files" do
stub(YtDlpRunnerMock, :run, fn _url, _opts, _ot, _addl -> {:ok, ""} end)
stub(YtDlpRunnerMock, :run, fn _url, :download_thumbnail, _opts, _ot, _addl -> {:ok, ""} end)
media_item = Repo.preload(media_item_with_attachments(), [:metadata, :source])
update_attrs = %{
@@ -789,7 +789,7 @@ defmodule Pinchflat.MediaTest do
end
test "deletes the media item's metadata files" do
stub(YtDlpRunnerMock, :run, fn _url, _opts, _ot, _addl -> {:ok, ""} end)
stub(YtDlpRunnerMock, :run, fn _url, :download_thumbnail, _opts, _ot, _addl -> {:ok, ""} end)
media_item = Repo.preload(media_item_with_attachments(), [:metadata, :source])
update_attrs = %{
@@ -875,7 +875,7 @@ defmodule Pinchflat.MediaTest do
end
test "does not delete the media item's metadata files" do
stub(YtDlpRunnerMock, :run, fn _url, _opts, _ot, _addl -> {:ok, ""} end)
stub(YtDlpRunnerMock, :run, fn _url, :download_thumbnail, _opts, _ot, _addl -> {:ok, ""} end)
media_item = Repo.preload(media_item_with_attachments(), [:metadata, :source])
update_attrs = %{