| 1472 | |
| 1473 | |
| 1474 | def existing_domain_dirs(config: dict[str, Any]) -> list[str]: |
| 1475 | output_mode, root_path = resolve_note_output_mode(config) |
| 1476 | papers_dir = str(config.get("papers_dir", "Research/Papers")).strip() or "Research/Papers" |
| 1477 | base_dir = root_path / Path(papers_dir) if output_mode == "obsidian" else root_path |
| 1478 | if not base_dir.exists() or not base_dir.is_dir(): |
| 1479 | return [] |
| 1480 | names: list[str] = [] |
| 1481 | for child in sorted(base_dir.iterdir()): |
| 1482 | if not child.is_dir(): |
| 1483 | continue |
| 1484 | if is_probable_paper_folder(child): |
| 1485 | continue |
| 1486 | names.append(child.name) |
| 1487 | return names |
| 1488 | |
| 1489 | |
| 1490 | def domain_name_score(domain_name: str, label: str, title: str, abstract: str) -> int: |