From: paul Date: Tue, 20 Jan 2015 11:16:59 +0000 (+0000) Subject: speed up length ordered file listing by using find instead of ls (omits unessecary... X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=65f4ae73d24e46c12cd983dee0a31e5a54829385;p=serve0 speed up length ordered file listing by using find instead of ls (omits unessecary stat'ing) svn path=/trunk/; revision=32 --- diff --git a/pages/videoview.sh b/pages/videoview.sh index 0787796..b786b74 100755 --- a/pages/videoview.sh +++ b/pages/videoview.sh @@ -118,7 +118,7 @@ VIDEOend _by_name(){ find ${_DATA}/videos/ -mindepth 1 -maxdepth 1 -printf '%f\n' |sort |egrep -i "$file_pattern" } _by_date(){ ls -c ${_DATA}/videos/ |egrep -i "$file_pattern" } -_by_length(){ ls ${_DATA}/by_length/ |sed -r 's:[0-9]{5} - ::g' } +_by_length(){ find ${_DATA}/by_length/ -mindepth 1 -maxdepth 1 -ptintf '%f\n' |sort |sed -r 's:[0-9]{5} - ::g' } thumblist() { cache="${_DATA}/cache/?o=${order}&s=${search}&f=${filter}&p=${page}"