mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 08:48:13 +00:00
Don't create empty output directories in the source path (#60)
This commit is contained in:
@@ -88,13 +88,10 @@ def download_project_from_url(project_url):
|
|||||||
progress_bar.update(len(chunk))
|
progress_bar.update(len(chunk))
|
||||||
# Close the progress bar
|
# Close the progress bar
|
||||||
progress_bar.close()
|
progress_bar.close()
|
||||||
else:
|
return referred_name, downloaded_file_url
|
||||||
return None, None
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error downloading file: {e}")
|
logger.error(f"Error downloading file: {e}")
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
return referred_name, downloaded_file_url
|
|
||||||
|
|
||||||
|
|
||||||
def process_zipped_project(zip_path):
|
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:
|
for job_data in jobs_list:
|
||||||
try:
|
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
|
# get new output path in output_dir
|
||||||
output_path = job_data.get('output_path')
|
output_path = job_data.get('output_path')
|
||||||
if not output_path:
|
if not output_path:
|
||||||
@@ -144,8 +137,10 @@ def create_render_jobs(jobs_list, loaded_project_local_path, job_dir):
|
|||||||
else:
|
else:
|
||||||
output_filename = os.path.basename(output_path)
|
output_filename = os.path.basename(output_path)
|
||||||
|
|
||||||
output_path = os.path.join(os.path.dirname(os.path.dirname(loaded_project_local_path)), 'output',
|
# Prepare output path
|
||||||
output_filename)
|
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}")
|
logger.debug(f"New job output path: {output_path}")
|
||||||
|
|
||||||
# create & configure jobs
|
# create & configure jobs
|
||||||
|
|||||||
Reference in New Issue
Block a user