X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;ds=sidebyside;f=pages%2Fcommon.sh;h=6b597d5abeb1d6b84cdb4f662462067632ff1fee;hb=285b1ceecc1204178cec53870a109c901d6a3839;hp=38296dfd8e28358bd0983a7b6d17962fdc589fc1;hpb=be2bfa17d3c7b2ed13c01ee42f54bd614cbbe3e9;p=serve0
diff --git a/pages/common.sh b/pages/common.sh
index 38296df..6b597d5 100755
--- a/pages/common.sh
+++ b/pages/common.sh
@@ -39,6 +39,21 @@ taglist=$(
done |sort -u |grep -xv '' |tee ${_DATA}/cache/taglist
)
+genthumb(){
+ videofile="$1"
+ thumb="$2"
+
+ 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(){
info="$1"
cache="${_DATA}/cache/$info.cache"
@@ -48,9 +63,9 @@ _printVideo(){
cat "$cache"
else
videofile="${_DATA}/videos/$info"
- thumb="${_DATA}/thumbs/$info.jpg"
- [ -r "$meta" ] || ${_EXEC}/helpers/genmeta.sh "$videofile" "$meta"
- [ -r "$thumb" ] || ${_EXEC}/helpers/genthumb.sh "$videofile" "$thumb"
+ thumb="${_DATA}/thumbs/${info}.jpg"
+ [ -r "$thumb" ] || genthumb "$videofile" "$thumb"
+ [ -r "$meta" ] || genmeta "$videofile" "$meta"
head -n1 "$meta" |read length width height filename
[ -z "$length" ] && length=0
@@ -61,6 +76,7 @@ _printVideo(){
video="$(urlsafe "videos/$info")"
thumb="$(urlsafe "thumbs/$info.jpg")"
linkinfo="$(urlsafe "$info")"
+ htmlinfo="$(htmlsafe "$info")"
[ "$(($length % 60))" -lt 10 ] && minutes="$(($length / 60)):0$(($length % 60))" \
|| minutes="$(($length / 60)):$(($length % 60))"
@@ -70,9 +86,9 @@ _printVideo(){
-