]> git.plutz.net Git - serve0/blobdiff - pages/common.sh
stop mplayer helpers from consuming stdin, remove dependency on `at`
[serve0] / pages / common.sh
index e03e6f5da8e5e9c7e2f413594713f7f82c448f2c..6b597d5abeb1d6b84cdb4f662462067632ff1fee 100755 (executable)
@@ -40,11 +40,18 @@ taglist=$(
 )
 
 genthumb(){
-  videofile="$(printf %s "$1" |sed -r "s;';'\\'';g")"
-      thumb="$(printf %s "$2" |sed -r "s;';'\\'';g")"
+  videofile="$1"
+  thumb="$2"
 
-  printf '%s\n' "${_EXEC}/helpers/genthumb.sh '$videofile' '$thumb' >/dev/null 2>/dev/null" \
-  | batch
+  nohup nice -10 "${_EXEC}"/helpers/genthumb.sh "$videofile" "$thumb" >/dev/null 2>/dev/null &
+  #printf '%s\n' "${_EXEC}/helpers/genthumb.sh '$videofile' '$thumb' >/dev/null 2>/dev/null" \
+  #| batch
+}
+genmeta(){
+  videofile="$1"
+  meta="$2"
+
+  "${_EXEC}"/helpers/genmeta.sh "$videofile" "$meta" >/dev/null
 }
 
 _printVideo(){
@@ -58,7 +65,7 @@ _printVideo(){
     videofile="${_DATA}/videos/$info"
     thumb="${_DATA}/thumbs/${info}.jpg"
     [ -r "$thumb" ] || genthumb "$videofile" "$thumb"
-    [ -r "$meta"  ] || "${_EXEC}/helpers/genmeta.sh" "$videofile" "$meta" >/dev/null
+    [ -r "$meta"  ] || genmeta "$videofile" "$meta"
 
     head -n1 "$meta" |read length width height filename
     [ -z "$length" ] && length=0