Skip to content

Commit

Permalink
Test file of "Show [01.02] Episode name with numbers 123.ext" and imp…
Browse files Browse the repository at this point in the history
…rove/rearrange patterns to parse this
  • Loading branch information
dbr committed May 22, 2011
1 parent 428bf18 commit ab2c6c8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
6 changes: 6 additions & 0 deletions tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@
'correctedseriesname': 'Scrubs',
'seasonnumber': 1, 'episodenumbers': [1],
'episodenames': ['My First Day']},

{'input': '30 Rock [2.10] Episode 210.avi',
'parsedseriesname': '30 Rock',
'correctedseriesname': '30 Rock',
'seasonnumber': 2, 'episodenumbers': [10],
'episodenames': ['Episode 210']},
]

files['misc'] = [
Expand Down
20 changes: 11 additions & 9 deletions tvnamer/config_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,17 @@
(?P<day>\d{2}) # day
[^\/]*$''',

# foo - [01.09]
'''^((?P<seriesname>.+?)) # show name
[ \._\-]? # padding
\[ # [
(?P<seasonnumber>[0-9]+?) # season
[.] # .
(?P<episodenumber>[0-9]+?) # episode
\] # ]
[ \._\-]? # padding
[^\\/]*$''',

# Foo - S2 E 02 - etc
'''^(?P<seriesname>.+?)[ ]?[ \._\-][ ]?
[Ss](?P<seasonnumber>[0-9]+)[\.\- ]?
Expand Down Expand Up @@ -288,15 +299,6 @@
[Ee](?P<episodenumber>[0-9]+) # E123
[\._ -][^\\/]*$ # More padding, then anything
''',

# foo - [01.09]
'''^((?P<seriesname>.+?)[ \._\-])? # show name and padding
\[? # [ optional
(?P<seasonnumber>[0-9]+) # season
[.] # x
(?P<episodenumber>[0-9]+) # episode
\]? # ] optional
[^\\/]*$''',
],

# Formats for renamed files. Variations for with/without episode,
Expand Down

0 comments on commit ab2c6c8

Please sign in to comment.