]> git.plutz.net Git - serve0/commitdiff
optimise listing for inode order
authorpaul <paul@plutz.net>
Mon, 4 Dec 2017 00:23:19 +0000 (00:23 +0000)
committerpaul <paul@plutz.net>
Mon, 4 Dec 2017 00:23:19 +0000 (00:23 +0000)
svn path=/trunk/; revision=193

pages/list.sh

index 07d6d8c737b838901a7cb520edf8a0b3eeafae1b..89576f833fe2e04bdc6f9645fe71a07dfbe89511 100755 (executable)
@@ -98,9 +98,13 @@ VIDEOend
 genlist(){
   case "$order" in
     Date)
-      find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%T@ %f\n' \
-      | sort -r \
-      | cut -d\  -f2- \
+      find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%i\t%p\n' \
+      | sort -n \
+      | while read i file; do printf '%s\000' "$file"; done \
+      | xargs -0 stat -c '%Y   %n' \
+      | sort -nr \
+      | cut -f2- \
+      | sed 's;^.*/;;g;' \
       | egrep -i "$file_pattern"
       ;;
     Length)