Skip to content

Commit 46a637e

Browse files
fix dir fo renamer
1 parent 64394f1 commit 46a637e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services/renamer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ def extract_data(match_result):
3939
episode = match_result.group('episode')
4040
season = 1
4141

42-
season_match = re.match('.*(S(?P<season>[0-9]{1}))$', name)
42+
season_match = re.match('(?P<name>.*)(S(?P<season>[0-9]{1}))$', name)
4343
if season_match:
4444
season = int(season_match.group('season'))
45+
name = season_match.group('name')
4546

4647
season = '0' + str(season) if season < 10 else str(season)
48+
name = name.replace('_', ' ')
4749

4850
return name, season, episode

0 commit comments

Comments
 (0)