Ejemplo n.º 1
0
def update_subtitles(account_type, account_id, video_url_id, lang_id,
                     version_id):
    """Update a subtitles for a language"""
    celery_logger.info(
        "externalsites.tasks.update_subtitles"
        "(%s, %s, %s, %s, %s)", account_type, account_id, video_url_id,
        lang_id, version_id)
    try:
        account = get_account(account_type, account_id)
        language = SubtitleLanguage.objects.get(id=lang_id)
        video_url = VideoUrl.objects.get(id=video_url_id)
        version = SubtitleVersion.objects.get(id=version_id)
    except ObjectDoesNotExist, e:
        celery_logger.error('Lookup error in update_subtitles(): %s' % e,
                            exc_info=True,
                            extra={
                                'data': {
                                    'account_type': account_type,
                                    'account_id': account_id,
                                    'video_url_id': video_url_id,
                                    'lang_id': lang_id,
                                    'version_id': version_id,
                                }
                            })
        return
Ejemplo n.º 2
0
def update_all_subtitles(account_type, account_id):
    """Update all subtitles for a given account."""
    celery_logger.info("externalsites.tasks.update_all_subtitles(%s, %s)",
                       account_type, account_id)
    try:
        account = get_account(account_type, account_id)
    except ObjectDoesNotExist, e:
        celery_logger.error('Lookup error in update_all_subtitles(): %s' % e,
                            exc_info=True,
                            extra={
                                'data': {
                                    'account_type': account_type,
                                    'account_id': account_id,
                                    'video_url_id': video_url_id,
                                    'lang_id': lang_id,
                                    'version_id': version_id,
                                }
                            })
        return