def onPlayBackStarted(self): from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() live = 'false' streams = xbmc.getInfoLabel('Player.Filenameandpath') showID = xbmc.getInfoLabel('VideoPlayer.Writer') channel = xbmc.getInfoLabel('VideoPlayer.Director') _zattooDB_.set_playing(channel, showID, streams, 0) # load Keymap for liveTV if streams.find('dash-live') > -1 or streams.find( 'hls5-live') > -1 or streams.find( 'dashenc-live') > -1 or streams.find('hls7-live') > -1: live = 'true' self.loadKeymap() else: self.unloadKeymap() ret = xbmcgui.Window(12005).getProperty('after_recall') if ret == "2": program = _zattooDB_.get_showID(showID) nextprog = _zattooDB_.getPrograms( {'index': [channel]}, True, program[0]['end_date'] + datetime.timedelta(seconds=20), program[0]['end_date'] + datetime.timedelta(seconds=50)) debug('Nextprog' + str(nextprog)) start = to_seconds(nextprog[0]['start_date']) + 60 now = to_seconds(datetime.datetime.now()) while start > to_seconds(datetime.datetime.now()): xbmc.sleep(100) channel = nextprog[0]['channel'] showID = nextprog[0]['showID'] add = 'true' restart = 'true' start = 0 end = 0 xbmc.executebuiltin('RunPlugin("plugin://' + __addonId__ + '/?mode=watch_c&id=' + channel + '&showID=' + showID + '&restart=' + restart + '&add=' + add + '")') elif ret == "1" and live == 'false': add = 'true' restart = 'false' showID = '1' end = 0 start = 0 xbmc.executebuiltin('RunPlugin("plugin://' + __addonId__ + '/?mode=watch_c&id=' + channel + '&add=' + add + '")')
def onPlayBackStarted(self): from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() live = 'false' streams = xbmc.getInfoLabel('Player.Filenameandpath') showID = xbmc.getInfoLabel('VideoPlayer.Writer') channel = xbmc.getInfoLabel('VideoPlayer.Director') _zattooDB_.set_playing(channel, showID, streams, 0) # load Keymap for liveTV if streams.find('dash-live') > -1 or streams.find( 'hls5-live') > -1 or streams.find( 'dashenc-live') > -1 or streams.find('hls7-live') > -1: live = 'true' self.loadKeymap() else: self.unloadKeymap()