Skip to content

feat: implement search utility functions and add tests for Anime prov… - #3

Merged
heiznerd merged 1 commit into
mainfrom
feat/optimize-provider-search
Jul 23, 2026
Merged

feat: implement search utility functions and add tests for Anime prov…#3
heiznerd merged 1 commit into
mainfrom
feat/optimize-provider-search

Conversation

@heiznerd

Copy link
Copy Markdown
Contributor

…iders

Copilot AI review requested due to automatic review settings July 23, 2026 01:31
@heiznerd
heiznerd merged commit 20d5fbc into main Jul 23, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces shared search normalization/ranking utilities and updates Anime providers to use them for higher-quality, more stable search results (including Vietnamese diacritics handling and common “label” stripping).

Changes:

  • Added cleanSearchQuery and rankSearchResults utilities for consistent query cleaning, normalization, and result ranking.
  • Updated AnimeVietsub and Anime47 providers to use centralized ranking + improved fallback behavior and timeout control for browser-based fetches.
  • Added a new checks/search-check.mts script to validate the ranking behavior and provider search fallbacks.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
scrapers/search-utils.ts Adds reusable query cleaning + normalized ranking logic (accent-aware, label-stripping, stable ordering).
scrapers/providers/animevietsub.ts Uses the new utilities to merge/rank search candidates and refines Playwright timeout handling.
scrapers/providers/anime47.ts Uses the new utilities for better search relevance and adjusts API/HTML fallback behavior.
checks/search-check.mts Adds coverage for the new utilities and provider search fallback/ranking behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants