Build and send a book only when it changed

A key of the chapters, rules and metadata of a story tells if its book
changed. A check without a change no longer builds the book again, also
for a book that waits for an upload. A held book goes out without a new
build. The Rebuild button still builds and sends in each case.
This commit is contained in:
tim
2026-10-02 23:37:33 +02:00
parent f961e4781e
commit 7a36e26751
9 changed files with 367 additions and 55 deletions
+2 -1
View File
@@ -291,8 +291,9 @@ def delete_story(story_id: int) -> Any:
@app.post("/api/stories/<int:story_id>/download")
def download(story_id: int) -> Any:
data = _json()
# A rebuild that the user asks for also builds and sends a book that did not change.
return orchestrator.queue_story(
story_id, data.get("mode", DownloadMode.NEW.value), data.get("chapter_ids"), data.get("force_fields")
story_id, data.get("mode", DownloadMode.NEW.value), data.get("chapter_ids"), data.get("force_fields"), True
)