TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;)
@samueljones 

OK, first you need to decide in which window you would like to add this function, eg. script-tvguide-main.xml or else.

Lets say you choose script-tvguide-main.

Open gui.py and find class TVGuide, then from self.program you need to extract program.startDate and program.endDate, I think this should also be possible in TVGF. 

Create a new defining function (def) 

python:
def calcTime(self):
    startDelta = datetime.datetime.now() - self.program.startDate
    endDelta = datetime.datetime.now() - self.program.endDate

    s = (endDelta - startDelta)

    s = re.sub(r'^0:', '', str(s))
    s = re.sub(r':00$', 'min', str(s))
    s = re.sub(':', 'h', str(s))
    matchHour = re.search(r'h\d+min$', s)
    matchMin = re.search(r'^0\dmin', s)

    if matchHour:
        s = re.sub(r'min$', '', str(s))

    elif matchMin:
        s = re.sub(r'^0', '', str(s))

    self.setControlLabel(C_MAIN_CALC_TIME_EPG, '%s' % (s))

Add self.calcTime() to "def onInit(self):" at the end.

Then create an ID number for C_MAIN_CALC_TIME_EPG and add it to class TVGuide(xbmcgui.WindowXML):.

eg.
C_MAIN_CALC_TIME_EPG = 4232

Open up script-tvguide-main.xml and add a new label with ID 4232, now the function should be visible in time format: hours "1h 00" or minutes "60 min".


I might be a bit wrong and I haven't tested this implementation myself in TVGF.
Reply


Messages In This Thread
moved by bry - by bry - 2017-01-23, 23:08
Alternate Skins? - by Kanipek - 2017-03-21, 18:06
Recording - by Kanipek - 2017-03-22, 18:20
RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - by M89SE - 2019-07-27, 10:12
SetUp - by francismm - 2019-05-22, 15:32
RE: SetUp - by Cangeoboy - 2019-05-23, 20:36
RE: SetUp - by M89SE - 2019-08-09, 08:09
RE: SetUp - by JQZ* - 2019-05-24, 02:47
Logout Mark Read Team Forum Stats Members Help
TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;)8