Skip to content

Commit

Permalink
Test and regex-tweaks for "series 1x01-02" pattern [dbr#83]
Browse files Browse the repository at this point in the history
  • Loading branch information
dbr committed Aug 7, 2011
1 parent 14591fd commit cdc3c72
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@
'seasonnumber': 2, 'episodenumbers': [1, 2, 3],
'episodenames': ['My Overkill', 'My Nightingale', 'My Case Study']},

{'input': 'Scrubs - [02x01+02]',
'parsedseriesname': 'scrubs',
'correctedseriesname': 'Scrubs',
'seasonnumber': 2, 'episodenumbers': [1, 2],
'episodenames': ['My Overkill', 'My Nightingale']},

{'input': 'Scrubs 2x01+02',
'parsedseriesname': 'scrubs',
'correctedseriesname': 'Scrubs',
'seasonnumber': 2, 'episodenumbers': [1, 2],
'episodenames': ['My Overkill', 'My Nightingale']},

{'input': 'Flight.of.the.Conchords.S01E01-02.An.Ep.name.avi',
'parsedseriesname': 'Flight of the Conchords',
'correctedseriesname': 'Flight of the Conchords',
Expand Down
10 changes: 5 additions & 5 deletions tvnamer/config_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@
(?P<seasonnumber>[0-9]+) # 1
[xX](?P<episodenumberstart>[0-9]+) # first x23
( # -24 etc
[\-][0-9]+
[\-+][0-9]+
)*
[\-] # separator
[\-+] # separator
(?P<episodenumberend>[0-9]+) # final episode num
([\.\- ].* # must have a separator (prevents 1x01-720p from being 720 episodes)
([\.\-+ ].* # must have a separator (prevents 1x01-720p from being 720 episodes)
|
$)''',

Expand All @@ -194,8 +194,8 @@
?(?P<seasonnumber>[0-9]+) # season
[xX] # x
(?P<episodenumberstart>[0-9]+) # episode
(- [0-9]+)*
- # -
([\-+] [0-9]+)*
[\-+] # -
(?P<episodenumberend>[0-9]+) # episode
\] # \]
[^\\/]*$''',
Expand Down

0 comments on commit cdc3c72

Please sign in to comment.