Don't create empty output directories in the source path (#60)

This commit is contained in:
2023-11-04 23:58:08 -05:00
committed by GitHub
parent 06a613fcc4
commit c3b446be8e

View File

@@ -88,13 +88,10 @@ def download_project_from_url(project_url):
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
else:
return None, None
return referred_name, downloaded_file_url
except Exception as e:
logger.error(f"Error downloading file: {e}")
return None, None
return referred_name, downloaded_file_url
return None, None
def process_zipped_project(zip_path):
@@ -132,10 +129,6 @@ def create_render_jobs(jobs_list, loaded_project_local_path, job_dir):
for job_data in jobs_list:
try:
# prepare output paths
output_dir = os.path.join(job_dir, job_data.get('name') if len(jobs_list) > 1 else 'output')
os.makedirs(output_dir, exist_ok=True)
# get new output path in output_dir
output_path = job_data.get('output_path')
if not output_path:
@@ -144,8 +137,10 @@ def create_render_jobs(jobs_list, loaded_project_local_path, job_dir):
else:
output_filename = os.path.basename(output_path)
output_path = os.path.join(os.path.dirname(os.path.dirname(loaded_project_local_path)), 'output',
output_filename)
# Prepare output path
output_dir = os.path.join(os.path.dirname(os.path.dirname(loaded_project_local_path)), 'output')
output_path = os.path.join(output_dir, output_filename)
os.makedirs(output_dir, exist_ok=True)
logger.debug(f"New job output path: {output_path}")
# create & configure jobs