Unified · Split
| @@ -36,7 +36,7 @@ NORENAME=0 · 35 unmodified lines | |||
| 36 | NOPIC=0 | 36 | NOPIC=0 |
| 37 | REMOVE=0 | 37 | REMOVE=0 |
| 38 | PIC_SIZE="192x192" | 38 | PIC_SIZE="192x192" |
| 39 | FORMAT=${0##split2} | 39 | FORMAT=${0##.*split2} |
| 40 | FORMAT=${FORMAT%.sh} | 40 | FORMAT=${FORMAT%.sh} |
| 41 | 41 | ||
| 42 | # load settings | 42 | # load settings |
| @@ -49,7 +49,7 @@ unset CUE · 6 unmodified lines | |||
| 49 | unset CHARSET | 49 | unset CHARSET |
| 50 | FORCE=0 | 50 | FORCE=0 |
| 51 | 51 | ||
| 52 | HELP="Usage: split2flac.sh [OPTIONS] FILE | 52 | HELP="Usage: split2\${FORMAT}.sh [OPTIONS] FILE |
| 53 | -o DIRECTORY * - set output directory | 53 | -o DIRECTORY * - set output directory |
| 54 | -cue FILE - use file as a cue sheet | 54 | -cue FILE - use file as a cue sheet |
| 55 | -f FORMAT - use specified output format (current is \${FORMAT}) | 55 | -f FORMAT - use specified output format (current is \${FORMAT}) |
| @@ -73,7 +73,7 @@ HELP="Usage: split2flac.sh [OPTIONS] FILE · 17 unmodified lines | |||
| 73 | NOTE: '-c some_file.jpg -s' only allows cover images, it doesn't set a default one. | 73 | NOTE: '-c some_file.jpg -s' only allows cover images, it doesn't set a default one. |
| 74 | Supported FORMATs: flac, mp3, ogg." | 74 | Supported FORMATs: flac, mp3, ogg." |
| 75 | 75 | ||
| 76 | README="split2flac.sh splits one big APE/FLAC/WV file to FLAC/MP3/OGG tracks with tagging and renaming. | 76 | README="split2flac splits one big APE/FLAC/WV file to FLAC/MP3/OGG tracks with tagging and renaming. |
| 77 | It's better to pass '-p' option to see what will happen when actually splitting tracks. | 77 | It's better to pass '-p' option to see what will happen when actually splitting tracks. |
| 78 | You may want to pass '-s' option for the first run to save default configuration | 78 | You may want to pass '-s' option for the first run to save default configuration |
| 79 | (output dir, cover image size, etc.) so you won't need to pass a lot of options | 79 | (output dir, cover image size, etc.) so you won't need to pass a lot of options |
| @@ -305,9 +305,9 @@ echo "Setting tags" · 225 unmodified lines | |||
| 305 | i=1 | 305 | i=1 |
| 306 | while [ $i -le ${TRACKS_NUM} ]; do | 306 | while [ $i -le ${TRACKS_NUM} ]; do |
| 307 | TAG_TITLE=$(cueprint -n $i -t %t "${CUE}") | 307 | TAG_TITLE=$(cueprint -n $i -t %t "${CUE}") |
| 308 | f="${OUT}/$(printf %02i $i).${FORMAT}" | 308 | FILE_TRACK="$(printf %02i $i)" |
| 309 | FILE_TRACK=$(basename "$f" .${FORMAT}) | ||
| 310 | FILE_TITLE=$(echo ${TAG_TITLE} | ${VALIDATE}) | 309 | FILE_TITLE=$(echo ${TAG_TITLE} | ${VALIDATE}) |
| 310 | f="${OUT}/${FILE_TRACK}.${FORMAT}" | ||
| 311 | 311 | ||
| 312 | echo "$i: ${TAG_TITLE}" | 312 | echo "$i: ${TAG_TITLE}" |
| 313 | 313 | ||