History

print 'failed to split' files and write their names in split_failed.txt

Serge Zirukin committed 16 years ago

Commit 0abed7a1 parent 4f82ba11 file · +15 −0Browse files

Unified · Split

split2flac.sh+15−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
30CONFIG="${HOME}/.split2flac"30CONFIG="${HOME}/.split2flac"
31TMPCUE="${HOME}/.split2flac_sheet.cue"31TMPCUE="${HOME}/.split2flac_sheet.cue"
32TMPPIC="${HOME}/.split2flac_cover.jpg"32TMPPIC="${HOME}/.split2flac_cover.jpg"
33FAILED="split_failed.txt"
33 34
34NOSUBDIRS=035NOSUBDIRS=0
35NORENAME=036NORENAME=0
@@ -498,6 +499,7 @@ split_file () { · 462 unmodified lines
498}499}
499 500
500split_collection () {501split_collection () {
502 NUM_FAILED=0
501 while read -r FILE; do503 while read -r FILE; do
502 $msg "$cG>> $cC\"${FILE}\"$cZ"504 $msg "$cG>> $cC\"${FILE}\"$cZ"
503 unset PIC CUE505 unset PIC CUE
@@ -505,15 +507,28 @@ split_collection () { · 1 unmodified line
505 507
506 if [ ! $? -eq 0 ]; then508 if [ ! $? -eq 0 ]; then
507 emsg "Failed to split \"${FILE}\""509 emsg "Failed to split \"${FILE}\""
510 echo "${FILE}" >> "${FAILED}"
511 NUM_FAILED=$((${NUM_FAILED} + 1))
508 fi512 fi
509 513
510 echo514 echo
511 done515 done
516
517 return ${NUM_FAILED}
512}518}
513 519
514# searches for files in a directory and splits them520# searches for files in a directory and splits them
515split_dir () {521split_dir () {
522 rm -f "${FAILED}"
516 find "$1" -name '*.flac' -o -name '*.ape' -o -name '*.wv' | split_collection523 find "$1" -name '*.flac' -o -name '*.ape' -o -name '*.wv' | split_collection
524 NUM_FAILED=$?
525 if [ ${NUM_FAILED} -ne 0 ]; then
526 emsg "${NUM_FAILED} file(s) failed to split (already splited?):"
527 $msg "${cR}"
528 sort "${FAILED}" -o "${FAILED}"
529 cat "${FAILED}"
530 emsg "\nThese files are also listed in ${FAILED}."
531 fi
517}532}
518 533
519if [ -d "${INPATH}" ]; then534if [ -d "${INPATH}" ]; then

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t