offset find: fail early and inform the user with CDs having less than 3 tracks

Fixes #532

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
This commit is contained in:
JoeLametta
2021-03-31 10:03:04 +00:00
parent 7691a51550
commit 84e4ef6ab8

View File

@@ -89,6 +89,11 @@ CD in the AccurateRip database."""
runner.run(t)
table = t.toc.table
if len(table.tracks) < 3:
logger.error("whipper offset find needs a CD with at least 3 "
"tracks on it to do its job")
return None
logger.debug("CDDB disc id: %r", table.getCDDBDiscId())
try:
responses = accurip.get_db_entry(table.accuraterip_path())