From b19f7dec2ffe0b845efa460f73a407c3a487ec7d Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 17 Oct 2026 20:28:56 +0000 Subject: [PATCH] Log a line whenever a save changes a project's length A project length that changed on its own is hard to place; the persisted Log now says when and from what to what. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01MpnF7GwNGMbngU11wjym7P --- core/routes.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/routes.py b/core/routes.py index 38de4b01..19bcba03 100644 --- a/core/routes.py +++ b/core/routes.py @@ -882,12 +882,15 @@ def register(routes, prefix=None): body = await _body(req) if body is None: return web.json_response({"problems": ["expected a project object"]}, status=400) - if projects.get(pid) is None: + before = projects.get(pid) + if before is None: return web.json_response({"problems": ["no such project"]}, status=404) # The id comes from the URL, never the body: a PUT that names its own # target is a PUT that can write over a different project. - return web.json_response( - projects.save(projects.Project.from_dict({**body, "id": pid})).to_dict()) + saved = projects.save(projects.Project.from_dict({**body, "id": pid})) + if saved.num_frames_per_scene != before.num_frames_per_scene: # the Log keeps it: a length that changed on its own can be placed beside what else was going on + log.info("projects", f"{saved.name or pid}: length changed from {before.num_frames_per_scene} to {saved.num_frames_per_scene} frames (saved from the page)") + return web.json_response(saved.to_dict()) @routes.delete(P + "/api/projects/{pid}") async def _projects_delete(req):