Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/murfey/client/destinations.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ def determine_default_destination(
mid_path = source.absolute().relative_to(Path(data_dir).absolute())
if use_suggested_path:
with global_env_lock:
source_name = (
source.name
if source.name != "Images-Disc1"
else source.parent.name
)
if source.name == "Images-Disc1":
source_name = source.parent.name
elif source.name.startswith("Sample"):
source_name = f"{source.parent.name}_{source.name}"
else:
source_name = source.name
if environment.destination_registry.get(source_name):
_default = environment.destination_registry[source_name]
else:
Expand Down
17 changes: 11 additions & 6 deletions src/murfey/client/watchdir_multigrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def stop(self):
self.thread.join()
log.debug("MultigridDirWatcher thread stop completed")

def _handle_metadata(self, directory: Path):
def _handle_metadata(self, directory: Path, extra_directory: str):
self.notify(
directory,
extra_directory=f"metadata_{directory.name}",
extra_directory=extra_directory,
include_mid_path=False,
analyse=self._analyse,
limited=True,
Expand Down Expand Up @@ -130,16 +130,21 @@ def _process(self):
for sample in sample_dirs:
if len(list(sample.glob("*.mdoc"))):
if sample not in self._seen_dirs:
self._handle_metadata(sample)
self._handle_metadata(
sample,
extra_directory=f"metadata_{sample.parent.name}_{sample.name}",
)
self._handle_fractions(
d.parent.parent.parent
/ f"{d.parent.name}_{d.name}",
sample.parent.parent.parent
/ f"{sample.parent.name}_{sample.name}",
first_loop,
)

else:
if d.is_dir() and d not in self._seen_dirs:
self._handle_metadata(d)
self._handle_metadata(
d, extra_directory=f"metadata_{d.name}"
)
self._handle_fractions(d.parent.parent / d.name, first_loop)

if first_loop:
Expand Down