diff --git a/orchestration/sharepoint_renamer_orchestrator.py b/orchestration/sharepoint_renamer_orchestrator.py index 15917f0a2..3159a607b 100644 --- a/orchestration/sharepoint_renamer_orchestrator.py +++ b/orchestration/sharepoint_renamer_orchestrator.py @@ -67,7 +67,14 @@ class SharepointRenamerOrchestrator: self._dry_run = dry_run def _discover_roots(self) -> list[str]: - raise NotImplementedError + contents = self._sp_client.get_folders_in_path(BASE_PATH) + batch_roots = sorted( + f"{BASE_PATH}/{item['name']}" + for item in contents.get("value", []) + if "folder" in item + and item["name"].lower().startswith(BATCH_FOLDER_PREFIX.lower()) + ) + return [BASE_PATH, *batch_roots] def run(self) -> None: with open(self._csv_path, newline="", encoding="utf-8-sig") as f: