if me.series_title is not None and \
me.nseries > 1 and not me.single_series_p:
raise ExpectedError("can't force series name for multi-series list")
- six, series = 0, {}
- prefix = None
+ series = set()
if me.single_series_p:
- series["-"] = "S0"
- f.write("SERIES S0 %s\n" % quote(me.series_title))
+ f.write("SERIES - %s\n" % quote(me.series_title))
for season in me.seasons:
for ep in season:
+ label = ep.label()
+ title = ep.season.series.full_title
if me.single_series_p:
- prefix = ep.season.series.full_title
- stag = "S0"
+ stag = "-"
+ if title is not None: label = title + " " + label
else:
- skey = ep.season.series
- try:
- stag = series[skey]
- except KeyError:
- stag = "S%d" % six
- series[skey] = stag
- six += 1
- title = ep.season.series.full_title
- if title is None: title = me.series_title
+ if title is None: title = me.series_title
+ stag = ep.season.series.name
+ if stag is None: stag = "-"
+ if stag not in series:
f.write("SERIES %s %s\n" % (stag, quote(title)))
- label = ep.label()
- if prefix is not None: label = prefix + " " + label
- f.write("ENTRY %s %s %s %d %d %d %d\n" %
+ series.add(stag)
+ f.write("ENTRY %s %s %s %d %d %d %g\n" %
(stag, quote(label), quote(ep.source.fn),
ep.tno, ep.start_chapter, ep.end_chapter, ep.duration))