Updated fast indexing to respect title filters (#136)

This commit is contained in:
Kieran
2024-03-27 19:39:50 -07:00
committed by GitHub
parent 23d65eaf5f
commit d1fe87bdf3
2 changed files with 22 additions and 0 deletions
+21
View File
@@ -325,6 +325,27 @@ defmodule Pinchflat.MediaTest do
assert Media.pending_download?(media_item)
end
test "returns true if the content matches the title regex" do
source = source_fixture(%{title_filter_regex: "(?i)^FOO$"})
media_item = media_item_fixture(%{source_id: source.id, media_filepath: nil, title: "foo"})
assert Media.pending_download?(media_item)
end
test "returns false if the content doesn't match the title regex" do
source = source_fixture(%{title_filter_regex: "(?i)^FOO$"})
media_item = media_item_fixture(%{source_id: source.id, media_filepath: nil, title: "bar"})
refute Media.pending_download?(media_item)
end
test "return true if there is no title regex" do
source = source_fixture(%{title_filter_regex: nil})
media_item = media_item_fixture(%{source_id: source.id, media_filepath: nil, title: "foo"})
assert Media.pending_download?(media_item)
end
end
describe "search/1" do