From e42e761dca58557799084ceafdf2088d85fe40c5 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 25 Oct 2022 11:13:23 -0400 Subject: Caption daemon --- roles/caption/templates/inotify-process-captions.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 roles/caption/templates/inotify-process-captions.sh (limited to 'roles/caption/templates/inotify-process-captions.sh') diff --git a/roles/caption/templates/inotify-process-captions.sh b/roles/caption/templates/inotify-process-captions.sh new file mode 100755 index 0000000..ce5f416 --- /dev/null +++ b/roles/caption/templates/inotify-process-captions.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# {{ ansible_managed }} + +# This script waits for new webm and mov files +# in the current directory (recursively) and then calls +# process-captions to process all the new files that need work. +inotifywait -r -m "{{ emacsconf_caption_dir }}" -e create -e moved_to | + while read directory action file; do + if [[ "$file" =~ .*(webm|mov)$ ]]; then + "{{ emacsconf_caption_dir }}"/process-captions.py | tee -a "{{ emacsconf_caption_dir }}/captions.log" + elif [[ "$file" =~ .*(vtt|srv2|ogg|opus)$ ]]; then + # Copy to backstage area + rsync --ignore-existing $directory/$file orga@media.emacsconf.org:/var/www/media.emacsconf.org/{{ emacsconf_year }}/backstage/ + fi + done -- cgit v1.2.3