- if season is None or i != season.i:
- check(season is None or i == season.i + 1,
- "season %d /= %d" % (i, season is None and -1 or season.i + 1))
- check(i not in seasons, "season %d already seen" % i)
- seasons[i] = season = VideoSeason(i, stitle)
- last_j = 0
- else:
- check(stitle == season.title,
- "season title `%s' /= `%s'" % (stitle, season.title))
- j = filter(some_group(m, "sdi", "di"), int)
- if j is not None:
- check(j == last_j + 1,
- "season %d disc %d /= %d" % (season.i, j, last_j + 1))
+ check(i is not None or stitle is None,
+ "explicit season title without number in `%s'" % fn)
+ if i is not None:
+ if season is None or i != season.i:
+ check(season is None or i == season.i + 1,
+ "season %d /= %d" %
+ (i, season is None and -1 or season.i + 1))
+ check(i not in seasons, "season %d already seen" % i)
+ seasons[i] = season = VideoSeason(i, stitle)
+ else:
+ check(stitle == season.title,
+ "season title `%s' /= `%s'" % (stitle, season.title))