From 9d1eae404781c4f14087964b0c2c0dc009aba4a6 Mon Sep 17 00:00:00 2001 From: zakary Date: Thu, 1 Feb 2024 15:49:35 -0600 Subject: [PATCH] update(group-matching): use startswith for group matching (#580) a few trackers truncate release names after certain lengths, leaving the possibility (although needs to be the right length) for groups to be truncated and partial groupnames returned from Torznab. While the truncation will not always be mid-groupname - this will provide a marginal amount of matches that otherwise would not be snatched. Potentially could use a "blacklist" for producing no-match when group name evaluates to something like "-DL" or something, to catch WEB-DL when truncated prior to the group name start, however this is a bit iffy too. --- src/decide.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/decide.ts b/src/decide.ts index a163cac1b..700876e1f 100644 --- a/src/decide.ts +++ b/src/decide.ts @@ -119,8 +119,9 @@ function releaseGroupDoesMatch( if (!searcheeMatch || !candidateMatch) { return matchMode === MatchMode.RISKY; } - - return searcheeMatch[0].toLowerCase() === candidateMatch[0].toLowerCase(); + return searcheeMatch[0] + .toLowerCase() + .startsWith(candidateMatch[0].toLowerCase()); } async function assessCandidateHelper(