Permalink
Browse files

Import performance optimizations to default branch

  • Loading branch information...
2 parents d9f1380 + 4de20c2 commit b0c29d7a6c645121518c6157c25013acc176580c Aldis Berjoza committed Dec 3, 2010
Showing with 10 additions and 13 deletions.
  1. +10 −13 bin/playd.sh
View
@@ -33,7 +33,7 @@
# 1}}}
# project email: playd@bsdroot.lv
-readonly PLAYD_VERSION='1.18.5'
+readonly PLAYD_VERSION='1.19.0'
readonly PLAYD_NAME="${0##*/}"
readonly PLAYD_FILE_FORMATS='mp3|flac|og[agxmv]|wv|aac|mp[421a]|wav|aif[cf]?|m4[abpr]|ape|mk[av]|avi|mpf|vob|di?vx|mpga?|mov|3gp|wm[av]|midi?'
readonly PLAYD_PLAYLIST_FORMATS='plst?|m3u8?|asx|xspf|ram|qtl|wax|wpl'
@@ -150,18 +150,15 @@ playd_mk_playlist() { # {{{1
# $1 - dir to make list
# $1 and $fileName must be double quoted to avoid
# problems with filenames that contain special characters
- ls "$1" | while read FILENAME; do
- if [ -f "$1/$FILENAME" ]; then
- local FNAME="$1/$FILENAME"
- echo "${FILENAME##*.}" | grep -q -i -E -e "^(${PLAYD_FILE_FORMATS})$" \
- && echo "$FNAME" >> "$PLAYD_PLAYLIST.tmp" \
- || { file -ib "$FNAME" | grep -q -E -e '^(audio|video)' && echo "$FNAME" >> "$PLAYD_PLAYLIST.tmp"; }
- elif [ -d "$1/$FILENAME" ]; then
- playd_mk_playlist "$1/$FILENAME"
- else
- playd_die "What the hell: \"$1/$FILENAME\""
- fi
- done
+ if [ -f "$1" ]; then
+ echo "${1##*.}" | grep -q -i -E -e "^(${PLAYD_FILE_FORMATS})$" \
+ && echo "$1" >> "$PLAYD_PLAYLIST.tmp" \
+ || { file -ib "$1" | grep -q -E -e '^(audio|video)' && echo "$1" >> "$PLAYD_PLAYLIST.tmp"; }
+ elif [ -d "$1" ]; then
+ find "$1" -type f | grep -E -i -e "(${PLAYD_FILE_FORMATS})$" >> "$PLAYD_PLAYLIST.tmp"
+ else
+ playd_die "What the hell: \"$1\""
+ fi
} # 1}}}
playd_fullpath() { # {{{1

0 comments on commit b0c29d7

Please sign in to comment.