Skip to content

Commit e19a013

Browse files
committed
fix for non-standard channel numbers
1 parent 9e46704 commit e19a013

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

addon.xml

Lines changed: 4 additions & 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.7.1"
4+
version="0.7.2"
55
provider-name="edit4ever">
66
<requires>
77
<import addon="xbmc.python" version="2.1.0"/>
@@ -19,6 +19,9 @@
1919
<platform>all</platform>
2020
<license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
2121
<news>
22+
v.7.2
23+
- fix for channels with non-standard numbers
24+
2225
v.7.1
2326
- fix incorrect xtra details
2427

zap2xml.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,9 +1223,11 @@ def incXML (st, en, fh):
12231223
# these cmp func need to be key objs too lazy right now
12241224
def sortChan(a,b):
12251225
global stations
1226-
1226+
p = re.compile("\d+\.\d+")
12271227
if "order" in stations[a] and "order" in stations[b]:
1228-
tmp = float(stations[a]["order"]) - float(stations[b]["order"])
1228+
ma = p.search(stations[a]["order"])
1229+
mb = p.search(stations[b]["order"])
1230+
tmp = float(ma.group()) - float(mb.group())
12291231
if tmp < 0.00:
12301232
return -1
12311233
if tmp == 0.00:
@@ -1240,7 +1242,6 @@ def sortChan(a,b):
12401242
if stations[a]["name"] > stations[b]["name"]:
12411243
return 1
12421244

1243-
12441245
def hex2dec_e(matchObj):
12451246
return "%s%d%s" % ('&#',ord(matchObj.group(1)),';')
12461247

0 commit comments

Comments
 (0)