-_printVideo(){
- info="$1"
- cache="${_DATA}/cache/$info.cache"
- meta="${_DATA}/meta/$info.meta"
-
- if [ "$cache" -nt "$meta" ]; then
- cat "$cache"
- else
- videofile="${_DATA}/videos/$info"
- thumb="${_DATA}/thumbs/${info}.jpg"
- [ -r "$thumb" ] || genthumb "$videofile" "$thumb"
- [ -r "$meta" ] || "${_EXEC}/helpers/genmeta.sh" "$videofile" "$meta" >/dev/null
-
- head -n1 "$meta" |read length width height filename
- [ -z "$length" ] && length=0
- [ -z "$width" ] && width=0
- [ -z "$height" ] && height=0
-
- tags="$(sed -n 2p "$meta")"
- 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))"
-
- tee "$cache" <<VIDEOend
- <li class="thumb">
- <a class="watchlink" name="${linkinfo}" href="?action=watch&i=${linkinfo}">
- <img src="$thumb" alt="Preview not yet available">
- </a>
- <h2>${htmlinfo}</h2>
-
- <input type="checkbox" name="tagsel" value="${htmlinfo}">
- <span class="info property">${minutes}min</span>
- <span class="info property">${width}x${height}</span>
- $(printf %s "$tags" |sed -r 's:\|*([^|]+)\|*: <span class="info tag">\1</span>:g')
- </li>
-VIDEOend
- fi
-}