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)$'
24 | mplayer -input nodefault-bindings -nosound -vo null -identify -frames 0 "$video" 2>&- \
26 s:ID_LENGTH=(.*)(\..*)$:\1:p;
27 s:ID_VIDEO_HEIGHT=(.*):\1:p;
28 s:ID_VIDEO_WIDTH=(.*):\1:p;' \
32 printf '%i\t%i\t%i\ttags=\tcomment=\t%s\n' \
33 "${l-0}" "${w-0}" "${h-0}" "$(meta_name "$video")"
39 meta="${file%/*}/.index/meta"
40 name="$(meta_name "$file")"
42 if [ -d "${meta%/meta}" ] && LOCK "$meta"; then
43 grep -avF " ${name}" "$meta" >"$meta.tmp"
46 mv "$meta.tmp" "$meta"
54 meta="${file%/*}/.index/meta"
55 name="$(meta_name "$file")"
57 if [ -d "${meta%/meta}" ] && LOCK "$meta"; then
58 grep -avF " ${name}" "$meta" >"$meta.tmp"
59 grep -aF " ${name}" "$meta" >>"$meta.trash"
60 mv "$meta.tmp" "$meta"
68 meta="${file%/*}/.index/meta"
70 if [ -d "${meta%/meta}" ]; then
71 grep -aF " $(meta_name "$file")" "$meta" \
72 | grep -m1 -axE '[0-9]+ [0-9]+ [0-9]+ tags=[^ ]* comment=[^ ]* .+' \
75 printf '0\t0\t0\ttags=\tcomment=\t\r'
82 meta="${dir}/.index/meta"
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" \
93 elif [ -d "$dir/.index" -a "$dir" -nt "$meta" ] && LOCK "$meta"; then
95 find "$dir" -type f -mindepth 1 -maxdepth 1 \
96 | grep -aE "$file_pattern" \
98 if [ "$v" -nt "$meta" ]; then
99 grep -qF " $(meta_name "$v")" "$meta" \