def grille_list(params):
    """This function list the videos for the 'All the Videos' and 'Reportages' sections."""
    p.log("ltl.grille_list " + repr(params))

    ctype = params.get('ctype')
    theme = params.get('theme')
    sorting = params.get('sorting')
    exclude = params.get('exclude', '')

    params_grille = {
        'type': ctype,
        'theme': theme,
        'sorting': sorting,
        'exclude': exclude,
        'limit': '15',
    }

    videos = api.get_video_items(params=params_grille,
                                 localized=get_located_string)
    reset_cache = 'yes' if params.get(
        'reset_cache') == 'yes' or videos['reset_cache'] else 'no'

    video_list = [{
        'thumbnail':
        video_entry.get('thumbnail') or '',
        'info': {
            'title': video_entry.get('title'),
            'plot': video_entry.get('plot') or '',
            'studio': video_entry.get('credits') or '',
            'genre': video_entry.get('genre') or '',
            'year': video_entry.get('year') or '',
            'rating': video_entry.get('rating') or '',
        },
        'path':
        p.get_plugin_path(
            url=video_entry['url'],
            action='play_video',
        ) if video_entry['IsPlayable'] else p.get_plugin_path(
            ctype=video_entry['type'],
            theme=video_entry['theme'],
            exclude=video_entry['exclude'],
            sorting=video_entry['sorting'],
            limit=video_entry['limit'],
            action='grille_list',
            reset_cache=reset_cache,
        ),
        'IsPlayable':
        video_entry['IsPlayable'],
    } for video_entry in videos['video_list']]

    p.add_items(video_list, reset_cache == 'yes')
def grille_list(params):
    """This function list the videos for the 'All the Videos' and 'Reportages' sections."""
    p.log("ltl.grille_list "+repr(params))

    ctype   = params.get('ctype')
    theme   = params.get('theme')
    sorting = params.get('sorting')
    exclude = params.get('exclude', '')

    params_grille = {
        'type'    : ctype,
        'theme'   : theme,
        'sorting' : sorting,
        'exclude' : exclude,
        'limit'   : '15',
        }

    videos      = api.get_video_items(params=params_grille, localized=get_located_string)
    reset_cache = 'yes' if params.get('reset_cache') == 'yes' or videos['reset_cache'] else 'no'

    video_list = [ {
        'thumbnail'     : video_entry.get('thumbnail') or '',
        'info': {
            'title'     : video_entry.get('title'),
            'plot'      : video_entry.get('plot')      or '',
            'studio'    : video_entry.get('credits')   or '',
            'genre'     : video_entry.get('genre')     or '',
            'year'      : video_entry.get('year')      or '',
            'rating'    : video_entry.get('rating')    or '',
        },
        'path'          : p.get_plugin_path(
            url         = video_entry['url'],
            action      = 'play_video',
        ) if video_entry['IsPlayable'] else p.get_plugin_path(
            ctype       = video_entry['type'],
            theme       = video_entry['theme'],
            exclude     = video_entry['exclude'],
            sorting     = video_entry['sorting'],
            limit       = video_entry['limit'],
            action      = 'grille_list',
            reset_cache = reset_cache,
        ),
        'IsPlayable'    : video_entry['IsPlayable'],
        }  for video_entry in videos['video_list']]

    p.add_items(video_list, reset_cache == 'yes')
 def test_3_video_items(self):
     video_items = api.get_video_items()
     self.assertTrue(len(video_items.get('video_list', '')) > 10)
Ejemplo n.º 4
0
 def test_3_video_items(self):
     video_items = api.get_video_items()
     self.assertTrue(len(video_items.get('video_list', '')) > 15)