Skip to content

Commit 6655032

Browse files
committed
Add descriptive error to missing season pack
1 parent 3fbfdb6 commit 6655032

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

pythonbits/bb.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,13 @@ def _render_tv_specifier(self):
246246
title = self['title_arg']
247247
else:
248248
title = guess['title']
249-
return TvSpecifier(title, guess['season'],
250-
guess.get('episode', None))
249+
try:
250+
season = guess['season']
251+
except KeyError:
252+
raise Exception('Could not find a season in the path name. '
253+
'Try specifying it in the TITLE argument, '
254+
'e.g. "Some TV Show S02" for a season 2 pack')
255+
return TvSpecifier(title, season, guess.get('episode', None))
251256

252257
@form_field('tags')
253258
def _render_tags(self):

0 commit comments

Comments
 (0)