Skip to content

Commit

Permalink
fix(ep_regex): fixes matching resolution in single episode tv (cross-…
Browse files Browse the repository at this point in the history
…seed#562)

addresses the episode capture block capturing resolution when it follows
the episode number

original: https://regex101.com/r/vmpLmb/2

updated: https://regex101.com/r/vmpLmb/5

- [ ] needs further test cases checked
  • Loading branch information
zakkarry authored Dec 11, 2023
1 parent 6dc6374 commit b0542cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const PROGRAM_VERSION = packageDotJson.version;
export const USER_AGENT = `CrossSeed/${PROGRAM_VERSION}`;

export const EP_REGEX =
/^(?<title>.+?)[_.\s-]+(?:(?<season>S\d+)?[_.\s]?(?<episode>E\d+(?:[\s-]?E?\d+)?)|(?<date>(?<year>\d{4})[_.\s-](?<month>\d{2})[_.\s-](?<day>\d{2})))/i;
/^(?<title>.+?)[_.\s-]+(?:(?<season>S\d+)?[_.\s]?(?<episode>E\d+(?:[\s-]?E?\d+)?(?![ip]))(?!\d+[ip])|(?<date>(?<year>\d{4})[_.\s-](?<month>\d{2})[_.\s-](?<day>\d{2})))/i;
export const SEASON_REGEX =
/^(?<title>.+?)[_.\s-]+(?<season>S\d+)(?:[_.\s-]*?(?<seasonmax>S?\d+))?(?=[_.\s](?!E\d+))/i;
export const MOVIE_REGEX =
Expand Down

0 comments on commit b0542cb

Please sign in to comment.