]> git.phdru.name Git - audio-cdr-video.git/blob - audio/mp3/recode-tags-recursive.sh
Initail import
[audio-cdr-video.git] / audio / mp3 / recode-tags-recursive.sh
1 #! /bin/sh
2
3 if [ "$1" = "koi2win" ]; then
4    direction="$1"
5 elif [ "$1" = "win2koi" ]; then
6    direction="$1"
7 elif [ "$1" = "koi2utf" ]; then
8    direction="$1"
9 elif [ "$1" = "koi2utf8" ]; then
10    direction=koi2utf
11 elif [ "$1" = "win2utf" ]; then
12    direction="$1"
13 elif [ "$1" = "win2utf8" ]; then
14    direction=win2utf
15 else
16    echo "Usage: $0 koi2win|win2koi|koi2utf|win2utf"
17    exit 1
18 fi
19
20 PATH=$HOME/lib/audio/mp3:$PATH
21 umask 022
22
23 if [ "$2" ]; then
24    cd "$2" || exit 1 # or just do it in current directory
25 fi
26 start_dir="`pwd`"
27
28 find . -name PlayList.m3u -print |
29 while read path; do
30    dir="`dirname \"$path\"`"
31    cd "$dir" || exit 1
32    recode-tags-list.sh PlayList.m3u $direction
33    cd "$start_dir" || exit 1
34 done