X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=pages%2Flist.sh;h=5628136ec94a389296b6ae666116bd2532e01b83;hb=928455a621e5fe136bf1cad14bcb66bb54938388;hp=37f764e4bf15979d809a53d3bf91512929574ea7;hpb=40e3b00e9750af97ddb9a16ac7f2e1410afe2c4f;p=serve0 diff --git a/pages/list.sh b/pages/list.sh index 37f764e..5628136 100755 --- a/pages/list.sh +++ b/pages/list.sh @@ -1,6 +1,6 @@ #!/bin/zsh -# Copyright 2014 - 2016 Paul Hänsch +# Copyright 2014 - 2017 Paul Hänsch # # This file is part of Serve0. # @@ -17,6 +17,8 @@ # You should have received a copy of the GNU Affero General Public License # along with Serve0. If not, see . +page_link="p=list&" + . $_EXEC/pages/common.sh LF=' @@ -95,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 |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 }