diff --git a/VEDA_OS01/transcripts.py b/VEDA_OS01/transcripts.py index 1f75e69..eae4999 100644 --- a/VEDA_OS01/transcripts.py +++ b/VEDA_OS01/transcripts.py @@ -962,6 +962,11 @@ def handle_video_translations(video, translations, file_id, api_key, log_prefix) translation_state = translation_metadata['state'] target_language = translation_metadata['target_language_iso_639_1_code'] + LOGGER.info( + '[3PlayMedia Task] Translation metadata retrieved -- video=%s, translation_id=%s, language=%s, status=%s.', + video.studio_id, translation_id, target_language, translation_state + ) + if translation_state == COMPLETE: # Fetch the corresponding tracking process. translation_process = get_in_progress_translation_process( @@ -1016,6 +1021,11 @@ def handle_video_translations(video, translations, file_id, api_key, log_prefix) provider=TranscriptProvider.THREE_PLAY, ) + LOGGER.info( + '[3PlayMedia Task] Translation retrieval was successful -- video=%s, translation_id=%s, language=%s.', + video.studio_id, translation_id, target_language + ) + # 5 - if all the processes for this video are complete, update transcript status # for video in edx-val as well as edx-video-pipeline. video_jobs = TranscriptProcessMetadata.objects.filter(video=video) diff --git a/bin/heal b/bin/heal index 8ec01ef..53b722f 100755 --- a/bin/heal +++ b/bin/heal @@ -51,7 +51,8 @@ def main(): {cmd} -i veda_id {cmd} -c course_id {cmd} -s schedule - [-i -c -s] + {cmd} --process-translations + [-i -c -s --process-translations] Use --help to see all options. '''.format(cmd=sys.argv[0]) @@ -71,12 +72,27 @@ def main(): action='store_true' ) + parser.add_argument( + '--process-translations', + dest='process_translations', + help='Retrieves completed 3PlayMedia translations for the videos.', + action='store_true' + ) + args = parser.parse_args() veda_id = args.veda_id course_id = args.course_id schedule = args.schedule + process_translations = args.process_translations + if process_translations: + # Only kick off a round of retrieving successful + # translations from 3Play Media + os.environ['DJANGO_SETTINGS_MODULE'] = 'VEDA.settings.production' + retrieve_three_play_translations() + return + print '%s - %s: %s' % ('Healing', 'VEDA ID', veda_id) print '%s - %s: %s' % ('Healing', 'Course', course_id)