]> git.phdru.name Git - audio-cdr-video.git/blob - audio/mp3/recode-tags.sh
Initail import
[audio-cdr-video.git] / audio / mp3 / recode-tags.sh
1 #! /bin/sh
2
3
4 if [ "$2" = "koi2win" ]; then
5    direction="$2"
6 elif [ "$2" = "win2koi" ]; then
7    direction="$2"
8 elif [ "$2" = "koi2utf" ]; then
9    direction="$2"
10 elif [ "$2" = "koi2utf8" ]; then
11    direction=koi2utf
12 elif [ "$2" = "win2utf" ]; then
13    direction="$2"
14 elif [ "$2" = "win2utf8" ]; then
15    direction=win2utf
16 else
17    echo "Usage: $0 playlist koi2win|win2koi|koi2utf|win2utf"
18    exit 1
19 fi
20
21 cd "$1" || exit 1
22
23 PATH=$HOME/lib/audio/mp3:$PATH
24 umask 022
25
26 if [ "$direction" = "koi2win" ]; then
27    enc_from=koi8-r
28    enc_to=cp1251
29 elif [ "$direction" = "win2koi" ]; then
30    enc_from=cp1251
31    enc_to=koi8-r
32 elif [ "$direction" = "koi2utf" ]; then
33    enc_from=koi8-r
34    enc_to=utf-8
35 elif [ "$direction" = "win2utf" ]; then
36    enc_from=cp1251
37    enc_to=utf-8
38 fi
39
40 exec xargs -r -d\\n recode-id3.py -f $enc_from -t $enc_to < PlayList.m3u