Skip to content

Commit 796365b

Browse files
committed
fix for channel sort
1 parent 9fa697f commit 796365b

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

addon.xml

Lines changed: 3 additions & 4 deletions
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.7.3"
4+
version="0.7.5"
55
provider-name="edit4ever">
66
<requires>
77
<import addon="xbmc.python" version="2.1.0"/>
@@ -19,9 +19,8 @@
1919
<platform>all</platform>
2020
<license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
2121
<news>
22-
v0.7.3
23-
- fix executable on ubuntu
24-
22+
v0.7.5 - remove channel number sort for xmltv write - fix for strange channel numbers
23+
v0.7.3 - fix executable on ubuntu
2524
v0.7.2 - fix for channels with non-standard numbers
2625
v0.7.1 - fix incorrect xtra details
2726
v0.7.0 - fix login error with zap2it - added function to delete cache to solve issue with updating "favorite" channels

zap2xml.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def pout (self, pstr, log_type='none',printOut = True, func = False):
150150
br = None #browser global
151151
gridHours = 0
152152
loggedinMatchZ = 0
153-
loggedinStr = '.*Logout of your Zap2it account.*'
153+
loggedinStr = '.*Logout of your.*'
154154
programs = {}
155155
cp = None
156156
stations = {}
@@ -341,9 +341,12 @@ def on_td (self, tag, attrs):
341341
if cp != -1 and "-D" in options:
342342
fn = os.path.join(cacheDir,cp + ".js.gz")
343343
if not os.path.isfile(fn):
344-
data = getURL(urlRoot + "gridDetailService?pgmId=" + cp)
345-
if data: #sometimes we fail to get the url try to keep going
346-
wbf(fn, data)
344+
try:
345+
data = getURL(urlRoot + "gridDetailService?pgmId=" + cp)
346+
if data: #sometimes we fail to get the url try to keep going
347+
wbf(fn, data)
348+
except:
349+
pass
347350
if os.path.isfile(fn):
348351
log.pout("[D] Parsing: " + cp,'info')
349352
parseJSOND(fn)
@@ -1224,23 +1227,22 @@ def incXML (st, en, fh):
12241227
def sortChan(a,b):
12251228
global stations
12261229
p = re.compile("\d+\.\d+")
1227-
if "order" in stations[a] and "order" in stations[b]:
1228-
ma = p.search(stations[a]["order"])
1229-
mb = p.search(stations[b]["order"])
1230-
tmp = float(ma.group()) - float(mb.group())
1231-
if tmp < 0.00:
1232-
return -1
1233-
if tmp == 0.00:
1234-
return 0
1235-
if tmp > 0.00:
1236-
return 1
1237-
else:
1238-
if stations[a]["name"] < stations[b]["name"]:
1239-
return -1
1240-
if stations[a]["name"] == stations[b]["name"]:
1241-
return 0
1242-
if stations[a]["name"] > stations[b]["name"]:
1243-
return 1
1230+
# if "order" in stations[a] and "order" in stations[b]:
1231+
# ma = p.search(stations[a]["order"])
1232+
# mb = p.search(stations[b]["order"])
1233+
# tmp = float(ma.group()) - float(mb.group())
1234+
# if tmp < 0.00:
1235+
# return -1
1236+
# if tmp == 0.00:
1237+
# return 0
1238+
# if tmp > 0.00:
1239+
# return 1
1240+
if stations[a]["name"] < stations[b]["name"]:
1241+
return -1
1242+
if stations[a]["name"] == stations[b]["name"]:
1243+
return 0
1244+
if stations[a]["name"] > stations[b]["name"]:
1245+
return 1
12441246

12451247
def hex2dec_e(matchObj):
12461248
return "%s%d%s" % ('&#',ord(matchObj.group(1)),';')

0 commit comments

Comments
 (0)