Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent matching to episode if 'ep' is followed by a year #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wbio
Copy link

@wbio wbio commented Dec 10, 2024

PR to address #19. This updates the episode regex so that it fails if the set of numbers following the ep string is 4 digits (i.e. likely a year). In the current logic it passes if it has at least 1-3 digits, but does not evaluate whether there are additional digits after the 3rd one, so the string:

The Keep 1983 1080p Blu-ray AVC DTS-HD MA 2.0-FULLBRUTALiTY

Gets evaluated with a title of The Ke and an episode number of 198

@clement-escolano
Copy link
Owner

Hello and thank you for your pull request!

Usually, the handlers check for a "boundary" (meaning it should only match "ep 1983" but not "Keep 1983" so it should not cut words). However, the boundary was not set here to take into account things like "S23Ep12" for season and episode.
So I think the best approach is to check if there is a boundary or a number before "ep". If what is before is different (in your case, a letter), then it should not match.

Sorry if this is not clear, parsing torrent names is full of edge cases ^^ If you need more details, happy to discuss further :-)

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