Esempio n. 1
0
 def _getVideoInfo(self, video, time_zone = None):
     title = u'{0} ({1} {2} - {3} {4})'.format(video['name'], nw.getTranslation(30011), video['seasonNumber'], nw.getTranslation(30012), video['episodeNumber'])
     descr = video['description']
     
     if 'publishEnd' in video:
         if time_zone == None:
             time_zone = nw.gettzlocal()
             date = nw.strptime(video['publishEnd'], '%Y-%m-%dT%H:%M:%SZ')
             date = date.replace(tzinfo = nw.gettz('UTC'))
             date = date.astimezone(time_zone)
             descr = u'{0}\n\n{1} {2}'.format(descr, nw.getTranslation(30013), date.strftime(nw.datetime_format))
     
     plus = False
                         
     if 'packages' in video:
         descr = descr + "\n" + nw.getTranslation(30015) + ":" # cambiare stringa
         for p in video['packages']:
             if p == "Premium" :
                 pp = "Dplay plus"
                 plus = True
                 title = title + " (PLUS)"
             else:
                 pp = p
             
             descr = descr + " " + pp
     
     # aggiungere immagini
     
     return { 'img' : '' , 'title' : title, 'descr' : descr , 'plus' : plus}
Esempio n. 2
0
 def _getVideoInfo(self, video, time_zone = None):
   title = u'{0} ({1} {2} - {3} {4})'.format(video['Name'], nw.getTranslation(30011), video['SeasonNumber'], nw.getTranslation(30012), video['EpisodeNumber'])
   descr = video['Description']
   if video['PublishEndDate'] != None:
     if time_zone == None:
       time_zone = nw.gettzlocal()
     date = nw.strptime(video['PublishEndDate'], '%Y-%m-%dT%H:%M:%SZ')
     date = date.replace(tzinfo = nw.gettz('UTC'))
     date = date.astimezone(time_zone)
     descr = u'{0}\n\n{1} {2}'.format(descr, nw.getTranslation(30013), date.strftime(nw.datetime_format))
   return { 'img' : video['Images'][0]['Src'], 'title' : title, 'descr' : descr }