Skip to content

Commit 9cc7d23

Browse files
committed
in the serialem case there is no Images-Disc directory to worry about so need to return early when finding the source directory for the fractions
1 parent 2df656c commit 9cc7d23

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/murfey/client/contexts/spa_metadata.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,14 @@ def _foil_hole_positions(xml_path: Path, grid_square: int) -> Dict[str, FoilHole
7373
return foil_holes
7474

7575

76-
def _get_visitless_source(source: Path, environment: MurfeyInstanceEnvironment) -> str:
76+
def _get_visitless_source(
77+
source: Path, environment: MurfeyInstanceEnvironment, skip_search: bool = False
78+
) -> str:
7779
visitless_source_search_dir = "/".join(
7880
[part for part in source.parts if part != environment.visit]
7981
).replace("//", "/")
82+
if skip_search:
83+
return visitless_source_search_dir
8084
visitless_source_images_dirs = sorted(
8185
Path(visitless_source_search_dir).glob("Images-Disc*"),
8286
key=lambda x: x.stat().st_ctime,
@@ -131,7 +135,9 @@ def post_transfer_serialem(
131135
if environment and transferred_file.suffix == ".mrc":
132136
source = _get_source(transferred_file, environment)
133137
if source:
134-
visitless_source = _get_visitless_source(source, environment)
138+
visitless_source = _get_visitless_source(
139+
source, environment, skip_search=True
140+
)
135141
capture_post(
136142
base_url=str(environment.url.geturl()),
137143
router_name="session_control.spa_router",

0 commit comments

Comments
 (0)