minutes="$(printf "%d:%02d" $(($length / 60)) $(($length % 60)) )"
- tee "$cache" <<VIDEOend
- <li id="$attrinfo" class="thumb">
- <button class="watchlink" name="${linkinfo}" formaction="?action=watch&i=${linkinfo}">
- <img src="$thumb" alt="Preview not yet available">
- </button>
- <h2><a href="?action=watch&i=${linkinfo}">${htmlinfo}</a></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>
+ { tr -d '\n' |tee "$cache"; } <<-VIDEOend
+ <li id="$attrinfo" class="thumb">
+ <button class="watchlink" name="${linkinfo}" formaction="?action=watch&i=${linkinfo}">
+ <img src="$thumb" width="212" height="162" alt="Preview not yet available">
+ </button>
+ <h2><a href="?action=watch&i=${linkinfo}">${htmlinfo}</a></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
}
genlist(){
case "$order" in
Date)
- find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%T@ %f\n' \
- | sort -r \
- | cut -d\ -f2- \
+ find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%i\t%p\n' \
+ | sort -n \
+ | while read i file; do printf '%s\000' "$file"; done \
+ | xargs -0 stat -c '%Y %n' \
+ | sort -nr \
+ | cut -f2- \
+ | sed 's;^.*/;;g;' \
| egrep -i "$file_pattern"
;;
Length)
sed -sn 1p "${_DATA}"/meta/*.meta \
| sort -n \
- | sed -r 's;^[0-9\t]+\t;;'
+ | sed -r 's;^[0-9\t]+\t;;' \
| while read file; do
- [ -f "${_DATA}/videos/${file}" ] && printf '%s\\n' "$file"
+ [ -f "${_DATA}/videos/${file}" ] && printf '%s\n' "$file"
done
;;
Name)