fix image verify:

- accurip.py: raise exception if accuraterip db entry not found
- program.py: verify image with only one table, remove redundant check
This commit is contained in:
Samantha Baldwin
2017-09-10 22:35:10 -04:00
parent b98cc32fd0
commit 94b9a1bbf6
5 changed files with 25 additions and 28 deletions

View File

@@ -486,10 +486,10 @@ Log files will log the path to tracks relative to this directory.
logger.debug('writing m3u file for %r', discName)
self.program.write_m3u(discName)
if self.program.verifyImage(self.runner, self.ittoc, self.itable):
print('rip verified as accurate')
else:
print('rip NOT verified as accurate')
try:
self.program.verifyImage(self.runner, self.ittoc)
except accurip.EntryNotFound:
print('AccurateRip entry not found')
accurip.print_report(self.program.result)

View File

@@ -117,16 +117,12 @@ Verifies the image from the given .cue files against the AccurateRip database.
def do(self):
prog = program.Program(config.Config())
runner = task.SyncRunner()
cache = accurip.AccuCache()
for arg in self.options.cuefile:
arg = arg.decode('utf-8')
cueImage = image.Image(arg)
cueImage.setup(runner)
url = cueImage.table.getAccurateRipURL()
responses = cache.retrieve(url)
# FIXME: this feels like we're poking at internals.
prog.cuePath = arg
prog.result = result.RipResult()
@@ -135,9 +131,14 @@ Verifies the image from the given .cue files against the AccurateRip database.
tr.number = track.number
prog.result.tracks.append(tr)
prog.verifyImage(runner, responses)
print "\n".join(prog.getAccurateRipResults()) + "\n"
verified = False
try:
verified = prog.verifyImage(runner, cueImage.table)
except accurip.EntryNotFound:
print('AccurateRip entry not found')
accurip.print_report(prog.result)
if not verified:
sys.exit(1)
class Image(BaseCommand):