3 [ -n "$include_indexmeta" ] && return 0
6 . "$_EXEC/cgilite/storage.sh"
7 file_pattern='^.*\.(mov|ts|mpg|mpeg|mp4|m4v|avi|mkv|flv|sfv|wmv|ogm|ogv|webm|iso|rmvb)$'
11 fn="$1"; fn="${fn##*/}"; fn="${fn%.*}"
12 STRING "$fn"; printf '\r'
18 [ "${video%.part}" = "$video" -a -s "$video" ] || return 0
22 | mplayer -input nodefault-bindings -nosound -vo null -identify -frames 0 "$video" 2>&- \
24 s:ID_LENGTH=(.*)(\..*)$:\1:p;
25 s:ID_VIDEO_HEIGHT=(.*):\1:p;
26 s:ID_VIDEO_WIDTH=(.*):\1:p;' \
30 printf '%i\t%i\t%i\ttags=\tcomment=\t%s\n' \
31 "${l-0}" "${w-0}" "${h-0}" "$(meta_name "$video")"
37 meta="${file%/*}/.index/meta"
38 name="$(meta_name "$file")"
40 if [ -d "${meta%/meta}" ] && LOCK "$meta"; then
41 grep -avF " ${name}" "$meta" >"$meta.tmp"
44 mv "$meta.tmp" "$meta"
52 meta="${file%/*}/.index/meta"
53 name="$(meta_name "$file")"
55 if [ -d "${meta%/meta}" ] && LOCK "$meta"; then
56 grep -avF " ${name}" "$meta" >"${meta}.tmp"
57 grep -aF " ${name}" "$meta" >>"${meta}.trash"
58 mv "${meta}.tmp" "$meta"
65 file="$1"; meta="${file%/*}/.index/meta"
67 if [ -d "${meta%/meta}" ]; then
68 grep -aF " $(meta_name "$file")" "$meta" \
69 | grep -m1 -axE '[0-9]+ [0-9]+ [0-9]+ tags=[^ ]* comment=[^ ]* .+' \
72 printf '0\t0\t0\ttags=\tcomment=\t%s\r' "$(meta_name "$file")"
79 meta="${dir}/.index/meta"
80 metat="${dir}/.index/meta.time"
82 [ -f "$metat" ] || touch -d @0 "$metat"
84 if [ -d "$dir/.index" -a \! -f "$meta" ] && LOCK "$meta"; then
85 touch "$meta" # preliminary touch to prevent concurrent generators
86 find "$dir" -type f -mindepth 1 -maxdepth 1 \
87 | grep -aE "$file_pattern" \
94 elif [ -d "$dir/.index" -a "$dir" -nt "$metat" ] && LOCK "$meta"; then
96 find "$dir" -type f -newer "$metat" \
97 -mindepth 1 -maxdepth 1 \
98 | grep -aE "$file_pattern" \
100 grep -qF " $(meta_name "$v")" "$meta" \