Skip to content

Commit

Permalink
Add zero padding to episodes in utils.py
Browse files Browse the repository at this point in the history
Added option to zero-pad the episode and season numbers as `{0s}` and `{0e}`.
  • Loading branch information
breams committed Jan 30, 2016
1 parent e161923 commit 83e77cc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils.py
Expand Up @@ -128,7 +128,9 @@ def format_tvshow_year(year):
def format_tvshow_episode(info):
episode_format = _1CH.get_setting('format-tvshow-episode')
label = re.sub('\{s\}', str(info['season']), episode_format)
label = re.sub('\{0s\}', str(info['season']).zfill(2), episode_format)
label = re.sub('\{e\}', str(info['episode']), label)
label = re.sub('\{0e\}', str(info['episode']).zfill(2), label)
label = re.sub('\{t\}', info['title'], label)
label = re.sub('\{st\}', info['TVShowTitle'], label)
return label
Expand Down

0 comments on commit 83e77cc

Please sign in to comment.