Skip to content

Commit

Permalink
feat(filler): add distance check
Browse files Browse the repository at this point in the history
  • Loading branch information
5rahim committed Jun 21, 2024
1 parent 7915530 commit b846833
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/api/filler/filler.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ func (af *AnimeFillerList) Search(opts SearchOptions) (result *SearchResult, err
return nil, fmt.Errorf("no results found")
}

if bestResult.Distance > 10 {
return nil, fmt.Errorf("no results found")
}

// Get the result
for _, r := range ret {
if r.Title == bestResult.OriginalValue {
Expand Down

0 comments on commit b846833

Please sign in to comment.