def _scheduleAutoplaywith(self, channelId, programTitle, startTime, endTime):
t = startTime - datetime.datetime.now()
timeToAutoplaywith = ((t.days * 86400) + t.seconds) / 60
if timeToAutoplaywith < 0:
return
#timeToAutoplaywith = 1
name = self.createAlarmClockName(programTitle, startTime)
timestamp = time.mktime(startTime.timetuple())
xbmc.executebuiltin('AlarmClock(%s-start,RunScript(special://home/addons/script.tvguide.fullscreen/playwith.py,%s,%s),%d,True)' %
(name.encode('utf-8', 'replace'), channelId.encode('utf-8'), timestamp, timeToAutoplaywith - int(ADDON.getSetting('autoplaywiths.before'))))
t = endTime - datetime.datetime.now()
timeToAutoplaywith = ((t.days * 86400) + t.seconds) / 60
#timeToAutoplaywith = 0
if ADDON.getSetting('autoplaywiths.stop') == 'true':
xbmc.executebuiltin('AlarmClock(%s-stop,RunScript(special://home/addons/script.tvguide.fullscreen/stopwith.py,%s,%s),%d,True)' %
(name.encode('utf-8', 'replace'), channelId.encode('utf-8'), timestamp, timeToAutoplaywith + int(ADDON.getSetting('autoplaywiths.after'))))
autoplaywith.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录