Skip to content

Commit

Permalink
Fix season_info when episodes don't have air dates
Browse files Browse the repository at this point in the history
Show 'No episodes to watch' instead of 'Completely watched' if a season has unwatched episodes without air dates.
  • Loading branch information
ginggs authored and joaquimrocha committed Jul 16, 2015
1 parent 7535b1b commit 5a15686
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/SeriesFinale/series.py
Expand Up @@ -287,17 +287,17 @@ def get_season_info_markup(self, season):
episodes_to_watch = info['episodes_to_watch']
next_episode = info['next_episode']
season_info = ''
if not episodes_to_watch:
if next_episode:
season_info = _('No episodes to watch')
elif episodes:
season_info = _('Completely watched')
if self.is_completely_watched(season):
season_info = _('Completely watched')
else:
number_episodes_to_watch = len(episodes_to_watch)
season_info = gettext.ngettext('%s episode not watched',
if episodes_to_watch:
n_episodes_to_watch = len(episodes_to_watch)
season_info = gettext.ngettext('%s episode not watched',
'%s episodes not watched',
number_episodes_to_watch) \
% number_episodes_to_watch
n_episodes_to_watch) \
% n_episodes_to_watch
else:
season_info = _('No episodes to watch')
if next_episode:
next_air_date = next_episode.air_date
if next_air_date:
Expand Down

0 comments on commit 5a15686

Please sign in to comment.