file_pattern='^.*\.(mov|ts|mpg|mpeg|mp4|m4v|avi|mkv|flv|sfv|wmv|ogm|ogv|webm|iso|rmvb)$'
meta_name() {
+ local fn
fn="$1"
fn="${fn##*/}"
fn="${fn%.*}"
}
meta_line() {
+ local video l w h
video="$1"
read l h w <<__EOF
}
meta_file(){
+ local file meta name
file="$1"
meta="${file%/*}/.index/meta"
name="$(meta_name "$file")"
}
meta_info(){
+ local file meta
file="$1"
meta="${file%/*}/.index/meta"
}
meta_dir(){
+ local dir meta v
dir="${1}"
meta="${dir}/.index/meta"
. "$_EXEC/widgets.sh"
list_item() {
+ local name path length width height tags comment n
name="$(HTML "$1")"
path="$(HTML "$ITEM/$1")"
)
}
list_fs_index(){
+ local d
find "$_DATA/$ITEM" -type d -name .index \
| while d="$(line)"; do
meta_dir "${d%/.index}"
}
list_browse(){
+ local meta f fn file
meta="$_DATA/$ITEM/.index/meta"
meta_dir "$_DATA/$ITEM"
(cd "$_DATA/$ITEM";
fn="$(UNSTRING "${f#* }")"; fn="${fn%${CR}}";
file="$(printf '%s\n' "$_DATA/$ITEM/${fn}".*)"
file="${file##*/}"
- [ -e "$_DATA/$ITEM/$base/${file}" ] \
+ [ -e "$_DATA/$ITEM/${file}" ] \
&& printf '%s\n' "${file}"
done
}
list_index(){
+ local meta base fn file
(cd "$_DATA/$ITEM";
find ./ -path '*/.index/meta'
) | while meta="$(line)"; do
}
list_items() {
+ local mode
mode="$(COOKIE mode |grep -m1 -xE 'index|browse' || printf browse )"
[ "$mode" = browse -a "$ITEM" ] && printf '..\n'
}
list_paginate() {
+ local page i c n
page="$(GET p |grep -xE '[0-9]+' || printf 1)"
printf '[div .itemlist '
}
w_prefs(){
+ local fakemp4 mode
fakemp4="$(COOKIE fakemp4)"
mode="$(COOKIE mode)"
printf '
}
w_tagging(){
+ local tag category
printf '[div #multitag [input type="hidden" name="ref" value="%s"]' "$(HTML "$REQUEST_URI")"
printf '[a href="#" Hide][br]'