def send_video_status_update(updates):
    """
    Update video status in edx-val.
    """
    for update in updates:
        update_video_status(update.get('edxVideoId'), update.get('status'))
        LOGGER.info(
            'VIDEOS: Video status update with id [%s], status [%s] and message [%s]',
            update.get('edxVideoId'),
            update.get('status'),
            update.get('message')
        )


        if update.get('status')=='upload_completed':
            LOGGER.info(
                'VIDEOS: Processing video [%s]',
                update.get('edxVideoId')
            )
            dir = "/edx/videos/"
            if not os.path.exists(dir):
                os.makedirs(dir)
            os.mknod(dir+"%s" % update.get('edxVideoId'))

    return JsonResponse()
示例#2
0
def send_video_status_update(updates):
    """
    Update video status in edx-val.
    """
    for update in updates:
        update_video_status(update.get('edxVideoId'), update.get('status'))
        LOGGER.info(update.get('message'))

    return JsonResponse()
示例#3
0
 def test_update_video_status_logging(self, mock_logger):
     """
     Tests correct message is logged when `update_video_status` is called
     """
     video = Video.objects.create(**constants.VIDEO_DICT_FISH)
     api.update_video_status(video.edx_video_id, 'fail')
     mock_logger.info.assert_called_with(
         'VAL: Status changed to [%s] for video [%s]', 'fail',
         video.edx_video_id)
示例#4
0
def send_video_status_update(updates):
    """
    Update video status in edx-val.
    """
    for update in updates:
        update_video_status(update.get('edxVideoId'), update.get('status'))
        LOGGER.info(update.get('message'))

    return JsonResponse()
示例#5
0
def send_video_status_update(updates):
    """
    Update video status in edx-val.
    """
    for update in updates:
        update_video_status(update.get('edxVideoId'), update.get('status'))
        LOGGER.info(
            u'VIDEOS: Video status update with id [%s], status [%s] and message [%s]',
            update.get('edxVideoId'), update.get('status'),
            update.get('message'))

    return JsonResponse()
示例#6
0
def send_video_status_update(updates):
    """
    Update video status in edx-val.
    """
    for update in updates:
        update_video_status(update.get('edxVideoId'), update.get('status'))
        LOGGER.info(
            'VIDEOS: Video status update with id [%s], status [%s] and message [%s]',
            update.get('edxVideoId'),
            update.get('status'),
            update.get('message')
        )

    return JsonResponse()
示例#7
0
def send_video_status_update(updates):
    """
    Update video status in edx-val.
    """
    for update in updates:
        update_video_status(update.get('edxVideoId'), update.get('status'))
        LOGGER.info(
            'VIDEOS: Video status update with id [%s], status [%s] and message [%s]',
            update.get('edxVideoId'), update.get('status'),
            update.get('message'))

        if update.get('status') == 'upload_completed':
            LOGGER.info('VIDEOS: Processing video [%s]',
                        update.get('edxVideoId'))

            encode_videos.delay(update.get('edxVideoId'))

    return JsonResponse()