summaryrefslogtreecommitdiffstats
path: root/roles/caption/templates/process-prerec.sh
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-11-05 07:55:05 -0400
committerSacha Chua <sacha@sachachua.com>2022-11-05 07:55:05 -0400
commit0b07963c81155b621dd45b878b869a78b8c9de49 (patch)
tree86c8f7756784cb71d246e40967856c528a3edad4 /roles/caption/templates/process-prerec.sh
parentffe7c227fa5a617e23f74cab5f41758e00a6be5c (diff)
downloademacsconf-ansible-0b07963c81155b621dd45b878b869a78b8c9de49.tar.xz
emacsconf-ansible-0b07963c81155b621dd45b878b869a78b8c9de49.zip
Caption updates
Diffstat (limited to 'roles/caption/templates/process-prerec.sh')
-rwxr-xr-xroles/caption/templates/process-prerec.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/caption/templates/process-prerec.sh b/roles/caption/templates/process-prerec.sh
new file mode 100755
index 0000000..e49aa72
--- /dev/null
+++ b/roles/caption/templates/process-prerec.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# {{ ansible_managed }}
+
+ORIGINAL=$1
+REENCODED=$(echo "$ORIGINAL" | perl -pe 's/^(emacsconf-[0-9]*-.*?--.*?--.*?--).*/$1reencoded.webm/')
+SLUG=$(echo "$ORIGINAL" | perl -ne '/^emacsconf-[0-9]*-(.*?)--/ && print $1')
+MAIN=$(echo "$ORIGINAL" | perl -pe 's/^(emacsconf-[0-9]*-.*?--.*?--.*?--).*/$1main.webm/')
+SCREEN=reencode-$SLUG
+if ! ( screen -ls | grep -q $SLUG ); then
+ screen -dmS $SCREEN
+fi
+( cd /data/emacsconf/cache; ./update-cache )
+/data/emacsconf/2022/scripts/update-task-status.sh $SLUG "WAITING_FOR_PREREC" "PROCESSING"
+#if [[ ! -f "$REENCODED" ]]; then
+screen -S $SCREEN -X screen -t reencode-$SLUG /bin/bash -c "/data/emacsconf/2022/scripts/reencode.sh \"$ORIGINAL\" \"$REENCODED\" && /data/emacsconf/2022/scripts/upload.sh $REENCODED && exec /bin/bash" &
+#fi
+screen -S $SCREEN -X screen -t captions-$SLUG /bin/bash -c "/data/emacsconf/2022/scripts/process-captions.py $(dirname $ORIGINAL); /data/emacsconf/2022/scripts/update-task-status.sh $SLUG PROCESSING TO_ASSIGN; exec /bin/bash"
+screen -x $SCREEN