From 928455a621e5fe136bf1cad14bcb66bb54938388 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 15 Oct 2017 17:25:24 +0000 Subject: [PATCH] only show existing files when searching meta data svn path=/trunk/; revision=188 --- pages/list.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pages/list.sh b/pages/list.sh index 7dbe2d0..5628136 100755 --- a/pages/list.sh +++ b/pages/list.sh @@ -97,9 +97,25 @@ VIDEOend genlist(){ case "$order" in - Date) find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%T@ %f\n' |sort -r |cut -d\ -f2- |egrep -i "$file_pattern";; - Length) sed -sn 1p "${_DATA}"/meta/*.meta |sort -n |sed -r 's;^[0-9\t]+\t;;';; - Name) find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%f\n' |sort -f |egrep -i "$file_pattern";; + Date) + find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%T@ %f\n' \ + | sort -r \ + | cut -d\ -f2- \ + | egrep -i "$file_pattern" + ;; + Length) + sed -sn 1p "${_DATA}"/meta/*.meta \ + | sort -n \ + | sed -r 's;^[0-9\t]+\t;;' + | while read file; do + [ -f "${_DATA}/videos/${file}" ] && printf '%s\\n' "$file" + done + ;; + Name) + find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%f\n' \ + | sort -f \ + | egrep -i "$file_pattern" + ;; esac } -- 2.39.2