(2016-08-10, 03:18)iainmacleod Wrote: Yeah you are. What language would I need to learn to branch or assist?
Also, I notice that the TV Guide Fullscreen doesn't load the XML file with the appropriate offsets - but the standard TV Guide does. They are using the same files, I have the source.db of both add-ons and reloaded to confirm.
In addition, what do channels.ini and addons.ini do? I read this thread but didn't see any information.
Thanks
Sent from my ONE A2005
The channels.ini and addons.ini are if you want to import them from somewhere else.
They are optional.
If you use them, then any changes you make to the categories or addon streams will be overwritten on the next xmltv update.
The use case is having a central server and pushing the same changes to all your devices.
The addon is in python with sql for the database and xml for the xmltv.
The quickest way to learn a new programming language that I know of is here:
https://learnxinyminutes.com/
TV Guide actually parses the date in the wrong way and throws away the offset value.
I expect your webgrab setup has compensated for TV Guide and added another offset.
Compare these two:
TV Guide source.py
Code:
def parseXMLTVDate(self, dateString):
if dateString is not None:
if dateString.find(' ') != -1:
# remove timezone information
dateString = dateString[:dateString.find(' ')]
t = time.strptime(dateString, '%Y%m%d%H%M%S')
return datetime.datetime(t.tm_year, t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec)
else:
return None
TV Guide Fullscreen source.py
Code:
def parseXMLTVDate(self, origDateString):
if origDateString.find(' ') != -1:
# get timezone information
dateParts = origDateString.split()
if len(dateParts) == 2:
dateString = dateParts[0]
offset = dateParts[1]
if len(offset) == 5:
offSign = offset[0]
offHrs = int(offset[1:3])
offMins = int(offset[-2:])
td = datetime.timedelta(minutes=offMins, hours=offHrs)
else:
td = datetime.timedelta(seconds=0)
elif len(dateParts) == 1:
dateString = dateParts[0]
td = datetime.timedelta(seconds=0)
else:
return None
# normalize the given time to UTC by applying the timedelta provided in the timestamp
try:
t_tmp = datetime.datetime.strptime(dateString, '%Y%m%d%H%M%S')
except TypeError:
xbmc.log('[script.tvguide.fullscreen] strptime error with this date: %s' % dateString, xbmc.LOGDEBUG)
t_tmp = datetime.datetime.fromtimestamp(time.mktime(time.strptime(dateString, '%Y%m%d%H%M%S')))
if offSign == '+':
t = t_tmp - td
elif offSign == '-':
t = t_tmp + td
else:
t = t_tmp
# get the local timezone offset in seconds
is_dst = time.daylight and time.localtime().tm_isdst > 0
utc_offset = - (time.altzone if is_dst else time.timezone)
td_local = datetime.timedelta(seconds=utc_offset)
t = t + td_local
return t
else:
return None