Browse Source

mp3cat caused trouble with sorting, e.g. 100 after 10, not after 99

master
Marc 4 years ago
parent
commit
e5e18ba4c2
1 changed files with 4 additions and 1 deletions
  1. 5
      .config/scripts/mp3cat_all_subdirs.sh

5
.config/scripts/mp3cat_all_subdirs.sh

@ -4,7 +4,10 @@ for d in ./*; do
f=${d:2} f=${d:2}
cd "$d" cd "$d"
echo ${f}.mp3 echo ${f}.mp3
mp3cat -c 1 ./*.mp3 -o "${f}.mp3"
# find all mp3s, sort them (e.g. 100 after 99, not after 10),
# get only filenames, handle spaces, and pass list to mp3cat
find . -iname "*.mp3" -exec basename {} \; | sort -h | xargs -d '\n' mp3cat -c 1 -o "${f}.mp3"
# mp3cat -c 1 ./*.mp3 -o "${f}.mp3"
mv "${f}.mp3" ../ mv "${f}.mp3" ../
cd .. cd ..
fi fi

Loading…
Cancel
Save