Skip to content

Commit

Permalink
update(group-matching): use startswith for group matching (cross-seed…
Browse files Browse the repository at this point in the history
…#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.
  • Loading branch information
zakkarry authored Feb 1, 2024
1 parent 34ec9c2 commit 9d1eae4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/decide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9d1eae4

Please sign in to comment.