fix: prioritize media URL classification

This commit is contained in:
ik
2026-09-13 08:46:42 +07:00
parent 0b7df7f721
commit 3547598d37
6 changed files with 19 additions and 9 deletions
+8
View File
@@ -42,6 +42,14 @@ def test_rf4map_gateway_fish_filename_is_classified_as_fish() -> None:
assert items[0].entity_type == "fish"
def test_tackle_path_wins_over_fish_word_in_product_name() -> None:
items = extract_media_candidates(
'<img src="https://cdn.example/bait/crab.png" alt="Краб и рыба 14">',
source_page="https://example.test/fishes",
)
assert items[0].entity_type == "tackle"
def test_manifest_merges_and_binary_store_is_content_addressed(tmp_path: Path) -> None:
item = extract_media_candidates('<img src="/bait/worm.png" alt="Bait worm">', source_page="https://example.test")[0]
first = merge_manifest(tmp_path / "manifest.json", [item])