Skip to content

Commit 84cec23

Browse files
committed
more cleanups
additional fixes for screen listing issues remove season/episode numbers leading zeros in xdetails
1 parent 7c6603d commit 84cec23

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

zap2xml.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,17 +1231,18 @@ def enc(strng):
12311231
global options
12321232
t = strng
12331233
if "-E" not in options:
1234+
t = re.sub(" \'","\'",t) #needed to fix screener guide listing error - '
12341235
t = re.sub("&","&",t)
12351236
t = re.sub("\"",""",t)
12361237
t = re.sub("\'","'",t)
12371238
t = re.sub("<","&lt;",t)
12381239
t = re.sub(">","&gt;",t)
1239-
t = re.sub("``","&quot;",t)
1240-
t = re.sub("\'\'","&quot;",t)
1241-
t = re.sub("&apos;&apos;","&quot;",t)
1240+
t = re.sub("``","&quot;",t) #needed to fix screener guide listing errors
1241+
t = re.sub("\'\'","&quot;",t) #needed to fix screener guide listing errors
1242+
t = re.sub("&apos;&apos;","&quot;",t) #needed to fix screener guide listing errors
12421243

12431244
else:
1244-
if re.search("amp",options["-E"]): t = re.sub("&[^#]","&amp; ",t)
1245+
if re.search("amp",options["-E"]): t = re.sub("&","&amp;",t)
12451246
if re.search("quot",options["-E"]): t = re.sub("\"","&quot;",t)
12461247
if re.search("apos",options["-E"]): t = re.sub("\'","&apos;",t)
12471248
if re.search("lt",options["-E"]): t = re.sub("<","&lt;",t)
@@ -1544,9 +1545,9 @@ def makeDescsortList(optList):
15441545
cc = schedule['cc']
15451546
if "seasonNum" in program and "episodeNum" in program:
15461547
ss = program["seasonNum"]
1547-
sf = "Season %0*d" % (max(2, len(str(ss))), int(ss))
1548+
sf = "Season " + str(int(ss))
15481549
e = program["episodeNum"]
1549-
ef = "Episode %0*d" % (max(2, len(str(e))), int(e))
1550+
ef = "Episode " + str(int(e))
15501551
season = sf + " - " + ef
15511552

15521553
if "credits" in program:
@@ -1561,7 +1562,7 @@ def makeDescsortList(optList):
15611562
prev = g
15621563
else:
15631564
castlist = castlist + ", " + enc(g)
1564-
cast = cast + castlist
1565+
cast = cast + castlist
15651566

15661567
if 'title' in program:
15671568
prog = enc(program['title'])

0 commit comments

Comments
 (0)