Added revised book feature.
This commit is contained in:
@@ -36,7 +36,7 @@ def db_progress_callback(db_path, run_id, percent):
|
||||
except: break
|
||||
|
||||
@huey.task()
|
||||
def generate_book_task(run_id, project_path, bible_path, allow_copy=True, feedback=None, source_run_id=None, keep_cover=False):
|
||||
def generate_book_task(run_id, project_path, bible_path, allow_copy=True, feedback=None, source_run_id=None, keep_cover=False, exclude_folders=None):
|
||||
"""
|
||||
Background task to run the book generation.
|
||||
"""
|
||||
@@ -147,6 +147,10 @@ def generate_book_task(run_id, project_path, bible_path, allow_copy=True, feedba
|
||||
for item in os.listdir(latest_run_dir):
|
||||
# Copy only folders that look like books and have a manuscript
|
||||
if item.startswith("Book_") and os.path.isdir(os.path.join(latest_run_dir, item)):
|
||||
if exclude_folders and item in exclude_folders:
|
||||
utils.log("SYSTEM", f" -> Skipping copy of {item} (Target for revision).")
|
||||
continue
|
||||
|
||||
if os.path.exists(os.path.join(latest_run_dir, item, "manuscript.json")):
|
||||
src = os.path.join(latest_run_dir, item)
|
||||
dst = os.path.join(current_run_dir, item)
|
||||
|
||||
Reference in New Issue
Block a user