Fix some issues around adding jobs through local rest call

This commit is contained in:
Brett Williams
2022-12-07 13:45:15 -08:00
parent 7a3fed1960
commit 89b7cb38f7
2 changed files with 11 additions and 12 deletions

View File

@@ -22,7 +22,7 @@ class RenderJob:
self.date_created = datetime.now()
self.scheduled_start = None
self.renderer = renderer
self.name = name or os.path.basename(input_path) + '_' + self.date_created.isoformat()
self.name = name or os.path.basename(input_path) + '_' + self.date_created.strftime("%Y.%m.%d_%H.%M.%S")
self.worker = RenderWorkerFactory.create_worker(renderer, input_path, output_path, args)
self.worker.log_path = os.path.join(os.path.dirname(input_path), self.name + '.log')
@@ -45,7 +45,7 @@ class RenderJob:
try:
job_dict = self.__dict__.copy()
job_dict['status'] = self.render_status().value
job_dict['file_hash'] = self.file_hash if isinstance(self.file_hash, str) else self.file_hash()
job_dict['file_hash'] = self.file_hash if self.file_hash and isinstance(self.file_hash, str) else self.file_hash()
job_dict['worker'] = self.worker.__dict__.copy()
job_dict['worker']['status'] = job_dict['status']