user = User.objects.get(id=uid)
- try:
+ if not os.path.exists(BUILD_PATH):
os.makedirs(BUILD_PATH)
- except OSError as e:
- if e.errno == errno.EEXIST:
- pass
- else:
- raise
out_file = NamedTemporaryFile(delete=False, prefix='%d-' % aid, suffix='.%s' % self.ext, dir=BUILD_PATH)
out_file.close()
def prepare_audio(self, input_path):
files = []
- delete = []
if self.intro_flac:
files.append(standardize_audio(self.intro_flac.path))
- delete.append(files[-1])
- files.append(input_path)
+ files.append(standardize_audio(input_path, cache=False))
if self.outro_flac:
files.append(standardize_audio(self.outro_flac.path))
- delete.append(files[-1])
output = concat_audio(files)
- for d in delete:
+ for d in files:
unlink(d)
return output