Ejemplo n.º 1
0
 def guida_tv_canale_giorno(self, cid, dt):
     res = self.med.OttieniGuidaTV(
         cid, dt, dt + 86399999)  # 86399999 is one day minus 1 ms
     kodiutils.setContent('videos')
     if 'listings' in res:
         for el in res['listings']:
             program = el['program'] if 'program' in el else {}
             if (kodiutils.getSettingAsBool('fullguide')
                     or ('mediasetprogram$hasVod' in program
                         and program['mediasetprogram$hasVod'])):
                 infos = _gather_info(el)
                 arts = _gather_art(el)
                 s_time = staticutils.get_date_from_timestamp(
                     el['startTime']).strftime("%H:%M")
                 e_time = staticutils.get_date_from_timestamp(
                     el['endTime']).strftime("%H:%M")
                 s = "{s}-{e} - {t}".format(
                     s=s_time,
                     e=e_time,
                     t=el['mediasetlisting$epgTitle'].encode('utf8'))
                 kodiutils.addListItem(s, {
                     'mode': 'video',
                     'guid': program['guid']
                 },
                                       videoInfo=infos,
                                       arts=arts,
                                       properties={
                                           'ResumeTime': '0.0',
                                           'TotalTime': '0.0',
                                           'StartOffset': '0.0'
                                       },
                                       isFolder=False)
     kodiutils.endScript()
Ejemplo n.º 2
0
 def guida_tv_canale_giorno(self, cid, dt):
     res = self.med.OttieniGuidaTV(cid, dt, dt + 86399999)  # 86399999 is one day minus 1 ms
     if 'listings' in res:
         for el in res['listings']:
             if (kodiutils.getSettingAsBool('fullguide') or
                     ('mediasetprogram$hasVod' in el['program'] and
                      el['program']['mediasetprogram$hasVod'])):
                 infos = _gather_info(el)
                 arts = _gather_art(el)
                 s_time = staticutils.get_date_from_timestamp(
                     el['startTime']).strftime("%H:%M")
                 e_time = staticutils.get_date_from_timestamp(
                     el['endTime']).strftime("%H:%M")
                 s = "{s}-{e} - {t}".format(s=s_time, e=e_time,
                                            t=el['mediasetlisting$epgTitle'])
                 kodiutils.addListItem(s,
                                       {'mode': 'video', 'guid': el['program']['guid']},
                                       videoInfo=infos, arts=arts, isFolder=False)
     kodiutils.endScript()
Ejemplo n.º 3
0
 def guida_tv_canale_settimana(self, cid, dt):
     dt = staticutils.get_date_from_timestamp(dt)
     for d in range(0, 16):
         currdate = dt - timedelta(days=d)
         kodiutils.addListItem(kodiutils.getFormattedDate(currdate),
                               {'mode': 'guida_tv', 'id': cid,
                                'day': staticutils.get_timestamp_midnight(currdate)})
     # kodiutils.addListItem(kodiutils.LANGUAGE(32136),
     #                       {'mode': 'guida_tv', 'id': cid,
     #                       'week': staticutils.get_timestamp_midnight(dt - timedelta(days=7))})
     kodiutils.endScript()