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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user