From a9fa2baafe442a8f247526ad40ff31dcb322f65d Mon Sep 17 00:00:00 2001 From: Rushil Perera Date: Mon, 26 Aug 2024 22:12:00 -0400 Subject: [PATCH] fix: userPreferred best matches not being matched properly --- src/controllers/episodes/getByAniListId/aniwatch.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/episodes/getByAniListId/aniwatch.ts b/src/controllers/episodes/getByAniListId/aniwatch.ts index 7f57227..57362c1 100644 --- a/src/controllers/episodes/getByAniListId/aniwatch.ts +++ b/src/controllers/episodes/getByAniListId/aniwatch.ts @@ -75,7 +75,10 @@ function getAniwatchId( userPreferred: anime.jname, })), ); - return animes.find((anime) => anime.name === bestMatchingTitle)?.id; + return animes.find( + (anime) => + anime.name === bestMatchingTitle || anime.jname === bestMatchingTitle, + )?.id; }); }