-list_files(){
- (cd "$_DATA/$ITEM";
- find ./ -type f -mindepth 1 -maxdepth 1 \
- -exec stat -c '%Y %n' "${f#./}" '{}' + 2>&-
- ) \
- | { [ "$(GET o)" = Date ] && sort -rn || sort -k 2; } \
- | cut -d/ -f2-
+[ "$FILTER" ] && list_fex="$(
+ fex='p'
+ STRING "$FILTER^" \
+ | sed -r 's;\^;\n;g; s;[]\/\(\)\\\^\$\?\.\+\*\;\[\{\}];\\&;g' \
+ | while read -r f; do
+ [ ! "${f#~}" ] && continue
+ [ "${f#~}" = "$f" ] \
+ && fex="/(\ttags=([^\t]*,)?)(${f})((,[^\t]*)?\t)/{${fex}}" \
+ || fex="/(\ttags=([^\t]*,)?)(${f#~})((,[^\t]*)?\t)/d; ${fex}"
+ printf '%s\n' "${fex}"
+ done \
+ | tail -n1
+)"
+
+list_filemeta(){
+ local meta base f fn file
+ base="$1"
+ meta="$_DATA/$ITEM/$base/.index/meta"
+ meta_dir "$_DATA/$ITEM/$base"
+
+ if [ $ORDER = Name ]; then
+ sort -k6 "$meta"
+ elif [ $ORDER = Length ]; then
+ sort -n "$meta"
+ else
+ cat "$meta"
+ fi \
+ | if [ "$FILTER" ]; then
+ sed -nr "$list_fex"
+ elif [ "${SEARCH#!}" != "${SEARCH}" ]; then
+ grep -viE "$(STRING "${SEARCH#!}")"
+ else
+ grep -iE "$(STRING "${SEARCH}")"
+ fi |cut -f6 \
+ | UNSTRING \
+ | while read -r fn; do
+ file="$(printf '%s' "$_DATA/$ITEM/$base/${fn%${CR}}".*)"
+ file="${file##*/}"
+ [ -e "$_DATA/$ITEM/$base/${file}" ] \
+ && printf '%s\n' "${base}/${file}"
+ done