From 5a7fdd820bd3f320e4838ae73ddd343673047b2e Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Sat, 9 May 2026 22:06:14 -0400 Subject: [PATCH] Update mosaic URL formatting to zero-pad scan IDs to 6 digits --- spruce/session.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spruce/session.py b/spruce/session.py index 922fdf3..52fc50f 100644 --- a/spruce/session.py +++ b/spruce/session.py @@ -216,8 +216,10 @@ class MachineSession: # ------------------------------------------------------------------ def mosaic_url(self, scan_id: int) -> str: + # The server stores scan directories zero-padded to 6 digits (e.g. 010700/). + # Scans with IDs >= 100000 are unaffected since they are already 6 digits. return urljoin( - self.image_base_url, f"RootView_Database/{scan_id}/mosaic.jpg" + self.image_base_url, f"RootView_Database/{scan_id:06d}/mosaic.jpg" ) # ------------------------------------------------------------------ @@ -262,7 +264,7 @@ class MachineSession: ): sc = exc.response.status_code if attempt < retries: - log.debug( + log.warning( "Attempt %d/%d failed %s: %s — retrying in %.0fs", attempt, retries,