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
7979 It's better to pass \$cP'-p'\$cZ option to see what will happen when actually splitting tracks.
8080 You may want to pass \$cP'-s'\$cZ option for the first run to save default configuration
8181 (output dir, cover image size, etc.) so you won't need to pass a lot of options
82−every time, just a filename.
83−Script will try to find CUE sheet if it wasn't specified. It also supports internal CUE sheets."
82+every time, just a filename. Script will try to find CUE sheet if it wasn't specified.
83+It also supports internal CUE sheets (FLAC and WV)."
8484
8585 msg="echo -e"
8686
@@ -127,7 +127,7 @@ while [ "$1" ]; do · 40 unmodified lines
127127 -h|--help|-help) eval "$msg \"${HELP}\""; exit 0;;
128128 -*) eval "$msg \"${HELP}\""; emsg "\nUnknown option $1"; exit 1;;
129129 *)
130− if [ -n "${INPATH}" ]; then
130+ if [ "${INPATH}" ]; then
131131 eval "$msg \"${HELP}\""
132132 emsg "\nUnknown option $1"
133133 exit 1
@@ -193,6 +193,7 @@ split_file ( ) { · 59 unmodified lines
193193 fi
194194
195195 if [ "${CUESHEET}" ]; then
196+ $msg "${cP}Found internal cue sheet$cZ"
196197 CUE="${TMPCUE}"
197198 echo "${CUESHEET}" > "${CUE}"
198199
@@ -213,7 +214,7 @@ split_file ( ) { · 14 unmodified lines
213214 return 1
214215 fi
215216
216− if [ -n "${CHARSET}" ]; then
217+ if [ "${CHARSET}" ]; then
217218 $msg "${cG}Cue charset : $cP${CHARSET} -> utf-8$cZ"
218219 CUESHEET=$(iconv -f "${CHARSET}" -t utf-8 "${CUE}" 2>/dev/null)
219220 if [ $? -ne 0 ]; then
@@ -254,6 +255,7 @@ split_file ( ) { · 34 unmodified lines
254255 fi
255256 fi
256257
258+ $msg "${cG}Cue sheet :$cZ ${CUE}"
257259 $msg "${cG}Cover image :$cZ ${PIC:-not set}"
258260 $msg "${cG}Output dir :$cZ ${DIR:?Output directory was not set}"
259261
@@ -277,7 +279,7 @@ split_file ( ) { · 17 unmodified lines
277279
278280 unset TAG_DATE
279281
280− if [ -n "${YEAR}" ]; then
282+ if [ "${YEAR}" ]; then
281283 if [ ${YEAR} -ne 0 ]; then
282284 TAG_DATE="${YEAR}"
283285 fi
@@ -285,7 +287,7 @@ split_file ( ) { · 1 unmodified line
285287
286288 $msg "\n${cG}Artist :$cZ ${TAG_ARTIST}"
287289 $msg "${cG}Album :$cZ ${TAG_ALBUM}"
288− if [ -n "${TAG_DATE}" ]; then
290+ if [ "${TAG_DATE}" ]; then
289291 $msg "${cG}Year :$cZ ${TAG_DATE}"
290292 fi
291293 $msg "${cG}Tracks :$cZ ${TRACKS_NUM}\n"
@@ -380,12 +382,12 @@ split_file ( ) { · 88 unmodified lines
380382 "${FINAL}" >/dev/null
381383 RES=$?
382384
383− if [ -n "${TAG_DATE}" ]; then
385+ if [ "${TAG_DATE}" ]; then
384386 ${METAFLAC} --set-tag="DATE=${TAG_DATE}" "${FINAL}" >/dev/null
385387 RES=$RES$?
386388 fi
387389
388− if [ -n "${PIC}" ]; then
390+ if [ "${PIC}" ]; then
389391 ${METAFLAC} --import-picture-from="${PIC}" "${FINAL}" >/dev/null
390392 RES=$RES$?
391393 fi
@@ -400,7 +402,7 @@ split_file ( ) { · 8 unmodified lines
400402 "${FINAL}" >/dev/null
401403 RES=$?
402404
403− if [ -n "${TAG_DATE}" ]; then
405+ if [ "${TAG_DATE}" ]; then
404406 ${ID3TAG} -y"${TAG_DATE}" "${FINAL}" >/dev/null
405407 RES=$RES$?
406408 fi
@@ -414,7 +416,7 @@ split_file ( ) { · 7 unmodified lines
414416 -t "TRACKNUMBER=$i" >/dev/null
415417 RES=$?
416418
417− if [ -n "${TAG_DATE}" ]; then
419+ if [ "${TAG_DATE}" ]; then
418420 ${VORBISCOMMENT} "${FINAL}" -t "DATE=${TAG_DATE}" >/dev/null
419421 RES=$RES$?
420422 fi
@@ -429,12 +431,12 @@ split_file ( ) { · 8 unmodified lines
429431 -T "${TRACKS_NUM}" >/dev/null
430432 RES=$?
431433
432− if [ -n "${TAG_DATE}" ]; then
434+ if [ "${TAG_DATE}" ]; then
433435 ${MP4TAGS} "${FINAL}" -y "${TAG_DATE}" >/dev/null
434436 RES=$RES$?
435437 fi
436438
437− if [ -n "${PIC}" ]; then
439+ if [ "${PIC}" ]; then
438440 ${MP4TAGS} "${FINAL}" -P "${PIC}" >/dev/null
439441 RES=$RES$?
440442 fi
@@ -502,7 +504,7 @@ if [ -d "${INPATH}" ]; then · 61 unmodified lines
502504 fi
503505 $msg "${cG}Input dir :$cZ ${INPATH}$cZ"
504506 split_dir "${INPATH}"
505−elif [ -n "${INPATH}" ]; then
507+elif [ "${INPATH}" ]; then
506508 split_file "${INPATH}"
507509 else
508510 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