History

more info on cue sheets; make shorter (remove -n from tests)

Serge Zirukin committed 16 years ago

Commit ac043ab1 parent 3139b441 file · +15 −13Browse files

Unified · Split

split2flac.sh+15−13
@@ -79,8 +79,8 @@ Usage: \${cZ}split2\${FORMAT}.sh [\${cU}OPTIONS\$cZ] \${cU}FILE\$cZ [\${cU}OPTIO · 78 unmodified lines
79It's better to pass \$cP'-p'\$cZ option to see what will happen when actually splitting tracks.79It's better to pass \$cP'-p'\$cZ option to see what will happen when actually splitting tracks.
80You may want to pass \$cP'-s'\$cZ option for the first run to save default configuration80You may want to pass \$cP'-s'\$cZ option for the first run to save default configuration
81(output dir, cover image size, etc.) so you won't need to pass a lot of options81(output dir, cover image size, etc.) so you won't need to pass a lot of options
82every time, just a filename.82every time, just a filename. Script will try to find CUE sheet if it wasn't specified.
83Script will try to find CUE sheet if it wasn't specified. It also supports internal CUE sheets."83It also supports internal CUE sheets (FLAC and WV)."
84 84
85msg="echo -e"85msg="echo -e"
86 86
@@ -127,7 +127,7 @@ while [ "$1" ]; do · 40 unmodified lines
127 -h|--help|-help) eval "$msg \"${HELP}\""; exit 0;;127 -h|--help|-help) eval "$msg \"${HELP}\""; exit 0;;
128 -*) eval "$msg \"${HELP}\""; emsg "\nUnknown option $1"; exit 1;;128 -*) eval "$msg \"${HELP}\""; emsg "\nUnknown option $1"; exit 1;;
129 *)129 *)
130 if [ -n "${INPATH}" ]; then130 if [ "${INPATH}" ]; then
131 eval "$msg \"${HELP}\""131 eval "$msg \"${HELP}\""
132 emsg "\nUnknown option $1"132 emsg "\nUnknown option $1"
133 exit 1133 exit 1
@@ -193,6 +193,7 @@ split_file ( ) { · 59 unmodified lines
193 fi193 fi
194 194
195 if [ "${CUESHEET}" ]; then195 if [ "${CUESHEET}" ]; then
196 $msg "${cP}Found internal cue sheet$cZ"
196 CUE="${TMPCUE}"197 CUE="${TMPCUE}"
197 echo "${CUESHEET}" > "${CUE}"198 echo "${CUESHEET}" > "${CUE}"
198 199
@@ -213,7 +214,7 @@ split_file ( ) { · 14 unmodified lines
213 return 1214 return 1
214 fi215 fi
215 216
216 if [ -n "${CHARSET}" ]; then217 if [ "${CHARSET}" ]; then
217 $msg "${cG}Cue charset : $cP${CHARSET} -> utf-8$cZ"218 $msg "${cG}Cue charset : $cP${CHARSET} -> utf-8$cZ"
218 CUESHEET=$(iconv -f "${CHARSET}" -t utf-8 "${CUE}" 2>/dev/null)219 CUESHEET=$(iconv -f "${CHARSET}" -t utf-8 "${CUE}" 2>/dev/null)
219 if [ $? -ne 0 ]; then220 if [ $? -ne 0 ]; then
@@ -254,6 +255,7 @@ split_file ( ) { · 34 unmodified lines
254 fi255 fi
255 fi256 fi
256 257
258 $msg "${cG}Cue sheet :$cZ ${CUE}"
257 $msg "${cG}Cover image :$cZ ${PIC:-not set}"259 $msg "${cG}Cover image :$cZ ${PIC:-not set}"
258 $msg "${cG}Output dir :$cZ ${DIR:?Output directory was not set}"260 $msg "${cG}Output dir :$cZ ${DIR:?Output directory was not set}"
259 261
@@ -277,7 +279,7 @@ split_file ( ) { · 17 unmodified lines
277 279
278 unset TAG_DATE280 unset TAG_DATE
279 281
280 if [ -n "${YEAR}" ]; then282 if [ "${YEAR}" ]; then
281 if [ ${YEAR} -ne 0 ]; then283 if [ ${YEAR} -ne 0 ]; then
282 TAG_DATE="${YEAR}"284 TAG_DATE="${YEAR}"
283 fi285 fi
@@ -285,7 +287,7 @@ split_file ( ) { · 1 unmodified line
285 287
286 $msg "\n${cG}Artist :$cZ ${TAG_ARTIST}"288 $msg "\n${cG}Artist :$cZ ${TAG_ARTIST}"
287 $msg "${cG}Album :$cZ ${TAG_ALBUM}"289 $msg "${cG}Album :$cZ ${TAG_ALBUM}"
288 if [ -n "${TAG_DATE}" ]; then290 if [ "${TAG_DATE}" ]; then
289 $msg "${cG}Year :$cZ ${TAG_DATE}"291 $msg "${cG}Year :$cZ ${TAG_DATE}"
290 fi292 fi
291 $msg "${cG}Tracks :$cZ ${TRACKS_NUM}\n"293 $msg "${cG}Tracks :$cZ ${TRACKS_NUM}\n"
@@ -380,12 +382,12 @@ split_file ( ) { · 88 unmodified lines
380 "${FINAL}" >/dev/null382 "${FINAL}" >/dev/null
381 RES=$?383 RES=$?
382 384
383 if [ -n "${TAG_DATE}" ]; then385 if [ "${TAG_DATE}" ]; then
384 ${METAFLAC} --set-tag="DATE=${TAG_DATE}" "${FINAL}" >/dev/null386 ${METAFLAC} --set-tag="DATE=${TAG_DATE}" "${FINAL}" >/dev/null
385 RES=$RES$?387 RES=$RES$?
386 fi388 fi
387 389
388 if [ -n "${PIC}" ]; then390 if [ "${PIC}" ]; then
389 ${METAFLAC} --import-picture-from="${PIC}" "${FINAL}" >/dev/null391 ${METAFLAC} --import-picture-from="${PIC}" "${FINAL}" >/dev/null
390 RES=$RES$?392 RES=$RES$?
391 fi393 fi
@@ -400,7 +402,7 @@ split_file ( ) { · 8 unmodified lines
400 "${FINAL}" >/dev/null402 "${FINAL}" >/dev/null
401 RES=$?403 RES=$?
402 404
403 if [ -n "${TAG_DATE}" ]; then405 if [ "${TAG_DATE}" ]; then
404 ${ID3TAG} -y"${TAG_DATE}" "${FINAL}" >/dev/null406 ${ID3TAG} -y"${TAG_DATE}" "${FINAL}" >/dev/null
405 RES=$RES$?407 RES=$RES$?
406 fi408 fi
@@ -414,7 +416,7 @@ split_file ( ) { · 7 unmodified lines
414 -t "TRACKNUMBER=$i" >/dev/null416 -t "TRACKNUMBER=$i" >/dev/null
415 RES=$?417 RES=$?
416 418
417 if [ -n "${TAG_DATE}" ]; then419 if [ "${TAG_DATE}" ]; then
418 ${VORBISCOMMENT} "${FINAL}" -t "DATE=${TAG_DATE}" >/dev/null420 ${VORBISCOMMENT} "${FINAL}" -t "DATE=${TAG_DATE}" >/dev/null
419 RES=$RES$?421 RES=$RES$?
420 fi422 fi
@@ -429,12 +431,12 @@ split_file ( ) { · 8 unmodified lines
429 -T "${TRACKS_NUM}" >/dev/null431 -T "${TRACKS_NUM}" >/dev/null
430 RES=$?432 RES=$?
431 433
432 if [ -n "${TAG_DATE}" ]; then434 if [ "${TAG_DATE}" ]; then
433 ${MP4TAGS} "${FINAL}" -y "${TAG_DATE}" >/dev/null435 ${MP4TAGS} "${FINAL}" -y "${TAG_DATE}" >/dev/null
434 RES=$RES$?436 RES=$RES$?
435 fi437 fi
436 438
437 if [ -n "${PIC}" ]; then439 if [ "${PIC}" ]; then
438 ${MP4TAGS} "${FINAL}" -P "${PIC}" >/dev/null440 ${MP4TAGS} "${FINAL}" -P "${PIC}" >/dev/null
439 RES=$RES$?441 RES=$RES$?
440 fi442 fi
@@ -502,7 +504,7 @@ if [ -d "${INPATH}" ]; then · 61 unmodified lines
502 fi504 fi
503 $msg "${cG}Input dir :$cZ ${INPATH}$cZ"505 $msg "${cG}Input dir :$cZ ${INPATH}$cZ"
504 split_dir "${INPATH}"506 split_dir "${INPATH}"
505elif [ -n "${INPATH}" ]; then507elif [ "${INPATH}" ]; then
506 split_file "${INPATH}"508 split_file "${INPATH}"
507else509else
508 emsg "No input filename given. Use -h for help."510 emsg "No input filename given. Use -h for help."

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