Exemplo n.º 1
0
def view_transform_tasks(request):
    u"""Show the transformation tasks home page."""
    try:
        data = get_request_data(request, accepted_keys=api_core.db_find_keys, qs_only_first_value=True, optional=True)
        profiles = remove_underscores(api_core.get_transform_profiles(**data))
        data.setdefault(u'skip', 50)  # ask for the last 50 media assets if skip is not provided
        data.setdefault(u'spec', {u'status': Media.READY})  # filter the media assets that cannot be transformed
        # FIXME add more filters
        medias = remove_underscores(api_core.get_medias(**data))
        queues = remove_underscores(api_core.get_transform_queues())
        return {u'medias': medias, u'profiles': profiles, u'queues': queues}
    except Exception as e:
        logging.exception(e)
        return {u'errors': [unicode(e)]}
Exemplo n.º 2
0
def api_transform_queue(auth_user=None, api_core=None, request=None):
    u"""Return an array containing the transformation queues serialized to JSON."""
    return ok_200(api_core.get_transform_queues(), include_properties=True)