Skip to content

Commit e11a35a

Browse files
committed
fix for channels config without Tvh
1 parent eea8f1c commit e11a35a

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

addon.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="script.module.zap2epg" name="zap2epg" version="0.7.2" provider-name="edit4ever">
2+
<addon id="script.module.zap2epg" name="zap2epg" version="0.7.3" provider-name="edit4ever">
33
<requires>
44
<import addon="xbmc.python" version="2.7.13"/>
55
<import addon="script.module.dateutil" version="2.4.2"/>
@@ -29,7 +29,7 @@ Setup:
2929
<email></email>
3030
<source></source>
3131
<news>
32-
v0.7.2 - fixes issue with certain digital lineups (2018-01-18)
32+
v0.7.3 - fixes issue with channel configuration when not using Tvheadend (2018-01-19)
3333
</news>
3434
<assets>
3535
<icon>resources/icon.png</icon>

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v0.7.3 (2018-01-19)
2+
- fixes issue with channel configuration when not using Tvheadend
3+
14
v0.7.2 (2018-01-18)
25
- fixes issue with certain digital lineups
36

default.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,25 @@ def get_icon_path(icon_name):
8787
return os.path.join(addon_path, 'resources', 'img', icon_name+".png")
8888

8989
def create_cList():
90-
if not os.path.isfile(tvhList):
91-
channels_url = 'http://' + tvh_url + ':' + tvh_port + '/api/channel/grid?all=1&limit=999999999&sort=name'
92-
response = requests.get(channels_url)
93-
try:
94-
logging.info('Accessing Tvheadend channel list from: %s', channels_url)
95-
channels = response.json()
96-
with open(tvhList,"w") as f:
97-
json.dump(channels,f)
98-
except urllib2.HTTPError as e:
99-
logging.exception('Exception: tvhClist - %s', e.strerror)
100-
pass
101-
with open(tvhList) as tvhData:
102-
tvhClist = []
103-
tvhDict = json.load(tvhData)
104-
for ch in tvhDict['entries']:
105-
channelEnabled = ch['enabled']
106-
if channelEnabled == True:
107-
tvhClist.append(ch['number'])
90+
tvhClist = []
91+
if tvhoff == 'true':
92+
if not os.path.isfile(tvhList):
93+
channels_url = 'http://' + tvh_url + ':' + tvh_port + '/api/channel/grid?all=1&limit=999999999&sort=name'
94+
response = requests.get(channels_url)
95+
try:
96+
logging.info('Accessing Tvheadend channel list from: %s', channels_url)
97+
channels = response.json()
98+
with open(tvhList,"w") as f:
99+
json.dump(channels,f)
100+
except urllib2.HTTPError as e:
101+
logging.exception('Exception: tvhClist - %s', e.strerror)
102+
pass
103+
with open(tvhList) as tvhData:
104+
tvhDict = json.load(tvhData)
105+
for ch in tvhDict['entries']:
106+
channelEnabled = ch['enabled']
107+
if channelEnabled == True:
108+
tvhClist.append(ch['number'])
108109
lineupcode = xbmcaddon.Addon().getSetting('lineupcode')
109110
url = 'http://tvlistings.gracenote.com/api/grid?lineupId=&timespan=3&headendId=' + lineupcode + '&country=' + country + '&device=-&postalCode=' + zipcode + '&time=' + str(gridtime) + '&pref=-&userId=-'
110111
content = urllib2.urlopen(url).read()

zap2epg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def mainRun(userdata):
9595
country = 'USA'
9696
else:
9797
country = 'CAN'
98-
logging.info('Running zap2epg-0.7.2 for zipcode: %s and lineup: %s', zipcode, lineup)
98+
logging.info('Running zap2epg-0.7.3 for zipcode: %s and lineup: %s', zipcode, lineup)
9999
pythonStartTime = time.time()
100100
cacheDir = os.path.join(userdata, 'cache')
101101
dayHours = int(days) * 8 # set back to 8 when done testing

0 commit comments

Comments
 (0)