Skip to content

Commit 0a98959

Browse files
committed
various fixes...
- remove genres groups code (limited Tvh functionality) - fix space after ampersand - fix cast error - fix LIVE and NEW date - fix sortthing error - fix original air date timezone offset
1 parent 66335e8 commit 0a98959

File tree

4 files changed

+27
-30
lines changed

4 files changed

+27
-30
lines changed

addon.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
<addon id="script.module.zap2xml"
33
name="zap2xml"
4-
version="0.4"
4+
version="0.4.1"
55
provider-name="edit4ever">
66
<requires>
77
<import addon="xbmc.python" version="2.1.0"/>

resources/language/English/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<string id="32150">Download Program Icons</string>
1818
<string id="32160">Download Extra Program Details</string>
1919
<string id="32169">Add Delay If Extra Downloads Cause Failure</string>
20-
<string id="32170">Delay Between http Requests</string>
20+
<string id="32180">Delay Between http Requests</string>
2121
</strings>
2222

resources/settings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<setting label="32150" type="bool" id="picons" default="false"/>
1818
<setting label="32160" type="bool" id="xdetails" default="false"/>
1919
<setting label="32169" type="lsep" />
20-
<setting label="32170" type="slider" id="delay" default="0" range="0,.25,3" option="float"/>
20+
<setting label="32180" type="slider" id="delay" default="0" range="0,.25,3" option="float"/>
2121
</category>
2222
</settings>

zap2xml.py

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,14 @@ def on_td (self, tag, attrs):
320320
elif re.search('zc-g-S',my_dict[cls]):
321321
programs[cp]["genres"]["sports"] = 1
322322

323-
if re.search("^MV",cp):
324-
programs[cp]["genres"]["movie"] = 1
325-
elif re.search("^SP",cp):
326-
programs[cp]["genres"]["sports"] = 1
327-
elif re.search("^EP",cp):
328-
programs[cp]["genres"]["series"] = 9
329-
elif re.search("^SH",cp) and "-j" in options:
330-
programs[cp]["genres"]["series"] = 9
323+
# if re.search('^MV',cp):
324+
# programs[cp]["genres"]["movie"] = 1
325+
# elif re.search('^SP',cp):
326+
# programs[cp]["genres"]["sports"] = 1
327+
# elif re.search('^EP',cp):
328+
# programs[cp]["genres"]["series"] = 9
329+
# elif re.search('^SH',cp) and "-j" in options:
330+
# programs[cp]["genres"]["series"] = 9
331331

332332
if cp != -1 and "-D" in options:
333333
fn = os.path.join(cacheDir,cp + ".js.gz")
@@ -396,7 +396,7 @@ def on_li(self, tag, attrs):
396396
schedule[cs][sch]["cc"] = 'CC'
397397
elif re.search('zc-ic',my_dict[cls]):
398398
on_li_zc_ic = True
399-
elif re.search('zc-icons-live',my_dict[cls]):
399+
elif re.search('zc-ic-live',my_dict[cls]):
400400
schedule[cs][sch]["live"] = 'Live'
401401
setOriginalAirDate()
402402
elif re.search('zc-icons-hd',my_dict[cls]):
@@ -1322,7 +1322,7 @@ def printProgrammes(fh):
13221322
continue
13231323
p = schedule[station][s]["program"]
13241324
startTime = convTime(schedule[station][s]["time"])
1325-
startTZ= timezone(int(schedule[station][s]["time"]))
1325+
startTZ = timezone(int(schedule[station][s]["time"]))
13261326
if "endtime" in schedule[station][s]:
13271327
endTime = schedule[station][s]["endtime"]
13281328
else:
@@ -1359,27 +1359,22 @@ def printProgrammes(fh):
13591359
if "originalAirDate" in programs[p]:
13601360
origdate = enc(convDateLocal(programs[p]["originalAirDate"]))
13611361
finaldate = datetime.datetime.strptime(origdate, "%Y%m%d").strftime('%B %d, %Y')
1362-
date = "Aired: " + finaldate
1362+
date = "Originally Aired: " + finaldate
13631363
if "movie_year" in programs[p]:
13641364
date = "Released: " + programs[p]["movie_year"]
13651365
if "rating" in programs[p]:
1366-
ratings = enc(programs[p]["rating"]) + bullet
1366+
ratings = bullet + enc(programs[p]["rating"])
13671367
if "new" in schedule[station][s]:
1368-
new = "NEW" + bullet
1369-
origdate = startTime
1370-
finaldate = datetime.datetime.strptime(origdate, "%Y%m%d%H%M%S").strftime('%B %d, %Y')
1371-
date = "Airs: " + finaldate
1368+
new = "NEW"
1369+
date = ""
13721370
if "live" in schedule[station][s]:
1373-
live = "LIVE" + bullet
1374-
origdate = startTime
1375-
finaldate = datetime.datetime.strptime(origdate, "%Y%m%d%H%M%S").strftime('%B %d, %Y')
1376-
date = "Airs: " + finaldate
1371+
live = "LIVE"
1372+
date = ""
13771373
if "quality" in schedule[station][s]:
1378-
hd = "HD" + bullet
1374+
hd = bullet + "HD"
13791375
if "cc" in schedule[station][s]:
1380-
cc = "CC" + bullet
1376+
cc = bullet + "CC"
13811377
if "credits" in programs[p]:
1382-
global sortThing1, sortThing2
13831378
sortThing1= str(p)
13841379
sortThing2 = "credits"
13851380
cast = "Cast: "
@@ -1391,8 +1386,8 @@ def printProgrammes(fh):
13911386
prev = g
13921387
else:
13931388
castlist = castlist + ", " + enc(g)
1394-
cast = cast + castlist + bullet
1395-
tmp = tmp + live + new + ratings + hd + cc + cast + date
1389+
cast = bullet + cast + castlist
1390+
tmp = tmp + live + new + date + ratings + hd + cc + cast
13961391
tmp = tmp + end
13971392
fh.write(tmp)
13981393

@@ -1459,10 +1454,12 @@ def printProgrammes(fh):
14591454
cc = True
14601455
if not new and not live and re.search("^EP|^SH|^\d", str(p)):
14611456
fh.write("\t\t<previously-shown ")
1457+
oadTZ = ""
14621458
if "originalAirDate" in programs[p]:
14631459
date = convDateLocal(programs[p]["originalAirDate"])
1464-
fh.write("start=\"" + date + "000000\" ")
1465-
fh.write("/>\n")
1460+
oadTZ = timezone(int(programs[p]["originalAirDate"]))
1461+
fh.write("start=\"" + date + "000000" + " " + oadTZ + "\"")
1462+
fh.write(" />\n")
14661463
if new:
14671464
fh.write("\t\t<new />\n")
14681465
# not part of XMLTV format yet?

0 commit comments

Comments
 (0)