def listDays(self, cItem, nextCategory): printDBG("PlayRTSIW.listDays [%s]" % cItem) type = cItem['f_type'] channelId = cItem.get('f_channel_id', '') if 'f_date' not in cItem: dt = datetime.now() else: dt = datetime.strptime(cItem['f_date'], '%d-%m-%Y').date() baseUrl = self.getFullUrl('/play/v2/{0}/programDay/%s/{1}'.format( type, channelId)) for item in range(31): title = dt.strftime('%d-%m-%Y') url = baseUrl % title params = dict(cItem) params.update({ 'good_for_fav': False, 'category': nextCategory, 'title': title, 'url': url }) self.addDir(params) dt = PrevDay(dt) params = dict(cItem) params.update({ 'good_for_fav': False, 'title': _('Older'), 'f_date': dt.strftime('%d-%m-%Y') }) self.addDir(params)
def listMissed(self, cItem, nextCategory): printDBG("KijkNL.listMissed") dt = cItem.get('f_date', None) ITEMS_PER_PAGE = 15 if dt == None: dt = datetime.date.today() else: try: dt = datetime.datetime.strptime(dt, '%Y-%m-%d').date() except Exception: printExc() return dtIt = dt for m in range(ITEMS_PER_PAGE): url = self.tmpUrl + 'v1/default/sections/missed-all-' + dtIt.strftime( "%Y%m%d") params = { 'good_for_fav': False, 'category': nextCategory, 'title': dtIt.strftime("%d-%m-%Y"), 'url': url } self.addDir(params) dtIt = PrevDay(dtIt) params = dict(cItem) params.update({ 'good_for_fav': False, 'title': _('Next page'), 'f_date': dtIt.strftime('%Y-%m-%d') }) self.addDir(params)
def listSeriesPremiere(self, cItem, nextCategory): printDBG("KinomanCO.listSeriesPremiere [%s]" % cItem) dt = cItem.get('f_date', None) ITEMS_PER_PAGE = 3 if dt == None: dt = PrevDay(datetime.date.today()) spin = 1 nextPage = False else: try: dt = datetime.datetime.strptime(dt, '%Y-%m-%d').date() spin = cItem['f_direction'] nextPage = True except Exception: printExc() return dtIt = dt for m in range(ITEMS_PER_PAGE): premiere = [] params = dict(cItem) params.update({ 'good_for_fav': False, 'category': nextCategory, 'title': dtIt.strftime("%d-%m-%Y"), 'f_premiere': dtIt.strftime("%Y-%m-%d") }) self.addDir(params) dtIt = NextDay(dtIt) if spin == 1 else PrevDay(dtIt) if spin == -1: self.currList.reverse() if nextPage: if spin == -1: title = _('Older') else: title = _('Newer') params = dict(cItem) params.update({ 'good_for_fav': False, 'title': title, 'f_date': dtIt.strftime('%Y-%m-%d') }) self.addDir(params) else: dt = PrevDay(dt) params = dict(cItem) params.update({ 'good_for_fav': False, 'title': _('Older'), 'f_direction': -1, 'f_date': dt.strftime('%Y-%m-%d') }) self.addDir(params) params = dict(cItem) params.update({ 'good_for_fav': False, 'title': _('Newer'), 'f_direction': 1, 'f_date': dtIt.strftime('%Y-%m-%d') }) self.addDir(params)