From 96db9d27f5e84af54f078ee02180df1460e6d16d Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 16 Jan 2015 18:29:51 +0000 Subject: [PATCH] speed up name ordered file listing by using find instead of ls (this omits unessecary stat'ing) svn path=/trunk/; revision=31 --- pages/videoview.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/videoview.sh b/pages/videoview.sh index e90c951..0787796 100755 --- a/pages/videoview.sh +++ b/pages/videoview.sh @@ -116,7 +116,7 @@ VIDEOend fi } -_by_name(){ ls ${_DATA}/videos/ |egrep -i "$file_pattern" } +_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' } -- 2.39.2