Unified · Split
| @@ -304,6 +304,14 @@ split_file () { · 303 unmodified lines | ||
| 304 | 304 | TAG_ALBUM=$(${GETTAG} %T "${CUE}" 2>/dev/null) |
| 305 | 305 | TRACKS_NUM=$(${GETTAG} %N "${CUE}" 2>/dev/null) |
| 306 | 306 | |
| 307 | + if [ -z "${TRACKS_NUM}" ]; then | |
| 308 | + emsg "Failed to get number of tracks from CUE sheet." | |
| 309 | + emsg "There may be an error in the sheet." | |
| 310 | + emsg "Running ${GETTAG} %N \"${CUE}\" produces this:" | |
| 311 | + ${GETTAG} %N "${CUE}" | |
| 312 | + return 1 | |
| 313 | + fi | |
| 314 | + | |
| 307 | 315 | TAG_GENRE=$(awk '{ if (/REM[ \t]+GENRE[ \t]+(.*)/) { print $0; exit } }' < "${CUE}") |
| 308 | 316 | TAG_GENRE=$(echo ${TAG_GENRE} | sed 's/REM[ \t]\+GENRE[ \t]\+//;s/"\(.*\)"/\1/') |
| 309 | 317 | |