[Enhancement] Allow forcing a refresh of source metadata (#194)

* Stopped sources from fetching metadata on every update

* Added action button to force a metadata refresh
This commit is contained in:
Kieran
2024-04-18 15:35:53 -07:00
committed by GitHub
parent 526bc0c2e3
commit 98c2812ee8
9 changed files with 98 additions and 20 deletions
+12 -2
View File
@@ -514,14 +514,24 @@ defmodule Pinchflat.SourcesTest do
assert source.index_frequency_minutes == 0
end
test "updating will kickoff a metadata storage worker" do
test "updating will kickoff a metadata storage worker if the original_url changes" do
expect(YtDlpRunnerMock, :run, &playlist_mock/3)
source = source_fixture()
update_attrs = %{name: "some updated name"}
update_attrs = %{original_url: "https://www.youtube.com/channel/cba321"}
assert {:ok, %Source{} = source} = Sources.update_source(source, update_attrs)
assert_enqueued(worker: SourceMetadataStorageWorker, args: %{"id" => source.id})
end
test "updating will not kickoff a metadata storage worker other attrs change" do
source = source_fixture()
update_attrs = %{name: "some new name"}
assert {:ok, %Source{}} = Sources.update_source(source, update_attrs)
refute_enqueued(worker: SourceMetadataStorageWorker)
end
end
describe "update_source/3 when testing options" do