Preserve ToC file generated by cdrdao
Whipper uses cdrdao during its ripping process. With this commit it will now store cdrdao's generated tocfile in the ripping path. Preserving the tocfile allows users to easily burn ripped discs having a non-compliant cue sheet. Fixes #214.
This commit is contained in:
@@ -135,11 +135,21 @@ class _CD(BaseCommand):
|
||||
"--cdr not passed")
|
||||
return -1
|
||||
|
||||
# Change working directory before cdrdao's task
|
||||
if self.options.working_directory is not None:
|
||||
os.chdir(os.path.expanduser(self.options.working_directory))
|
||||
out_bpath = self.options.output_directory.decode('utf-8')
|
||||
# Needed to preserve cdrdao's tocfile
|
||||
out_fpath = self.program.getPath(out_bpath,
|
||||
self.options.disc_template,
|
||||
self.mbdiscid,
|
||||
self.program.metadata)
|
||||
# now, read the complete index table, which is slower
|
||||
self.itable = self.program.getTable(self.runner,
|
||||
self.ittoc.getCDDBDiscId(),
|
||||
self.ittoc.getMusicBrainzDiscId(),
|
||||
self.device, self.options.offset)
|
||||
self.device, self.options.offset,
|
||||
out_fpath)
|
||||
|
||||
assert self.itable.getCDDBDiscId() == self.ittoc.getCDDBDiscId(), \
|
||||
"full table's id %s differs from toc id %s" % (
|
||||
@@ -329,9 +339,6 @@ Log files will log the path to tracks relative to this directory.
|
||||
dirname.encode('utf-8'))
|
||||
logger.critical(msg)
|
||||
raise RuntimeError(msg)
|
||||
else:
|
||||
sys.stdout.write("output directory %s already exists\n" %
|
||||
dirname.encode('utf-8'))
|
||||
else:
|
||||
print("creating output directory %s" % dirname.encode('utf-8'))
|
||||
os.makedirs(dirname)
|
||||
|
||||
Reference in New Issue
Block a user