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'
21 | mplayer -input nodefault-bindings -nosound -vo null -identify -frames 0 "$video" 2>&- \
23 s:ID_LENGTH=(.*)(\..*)$:\1:p;
24 s:ID_VIDEO_HEIGHT=(.*):\1:p;
25 s:ID_VIDEO_WIDTH=(.*):\1:p;' \
29 printf '%i\t%i\t%i\ttags=\tcomment=\t%s\n' \
30 "${l-0}" "${w-0}" "${h-0}" "$(meta_name "$video")"
36 meta="${file%/*}/.index/meta"
37 name="$(meta_name "$file")"
39 if [ -d "${meta%/meta}" ] && LOCK "$meta"; then
40 grep -avF " ${name}" "$meta" >"$meta.tmp"
43 mv "$meta.tmp" "$meta"
51 meta="${file%/*}/.index/meta"
52 name="$(meta_name "$file")"
54 if [ -d "${meta%/meta}" ] && LOCK "$meta"; then
55 grep -avF " ${name}" "$meta" >"${meta}.tmp"
56 grep -aF " ${name}" "$meta" >>"${meta}.trash"
57 mv "${meta}.tmp" "$meta"
64 file="$1"; meta="${file%/*}/.index/meta"
66 if [ -d "${meta%/meta}" ]; then
67 grep -aF " $(meta_name "$file")" "$meta" \
68 | grep -m1 -axE '[0-9]+ [0-9]+ [0-9]+ tags=[^ ]* comment=[^ ]* .+' \
71 printf '0\t0\t0\ttags=\tcomment=\t%s\r' "$(meta_name "$file")"
78 meta="${dir}/.index/meta"
79 metat="${dir}/.index/meta.time"
81 [ -f "$metat" ] || touch -d @0 "$metat"
83 if [ -d "$dir/.index" -a \! -f "$meta" ] && LOCK "$meta"; then
84 touch "$meta" # preliminary touch to prevent concurrent generators
85 find "$dir" -type f -mindepth 1 -maxdepth 1 \
86 | grep -aE "$file_pattern" \
92 elif [ -d "$dir/.index" -a "$dir" -nt "$metat" ] && LOCK "$meta"; then
93 cp -p "$meta" "$meta.ref"; touch "$meta"
94 find "$dir" -type f -newer "$metat" \
95 -mindepth 1 -maxdepth 1 \
96 | grep -aE "$file_pattern" \
98 grep -qF " $(meta_name "$v")" "$meta" \
101 sort -u "$meta" >"$meta.ref"
102 mv "$meta.ref" "$meta"