()
| 469 | |
| 470 | |
| 471 | def _reading_report_dirs() -> List[Path]: |
| 472 | configured = Path(_configured_path("PAPERFLOW_READING_REPORTS_DIR", "data/exports")).resolve() |
| 473 | if _env_text("PAPERFLOW_READING_REPORTS_DIR", ""): |
| 474 | return [configured] if configured.exists() and configured.is_dir() else [configured] |
| 475 | fallback = (PROJECT_ROOT / "data" / "reading_reports").resolve() |
| 476 | legacy_exports = (PROJECT_ROOT / "data" / "exports").resolve() |
| 477 | ordered = [configured] |
| 478 | notes_git_dir = _configured_reading_notes_git_dir() |
| 479 | if notes_git_dir is not None: |
| 480 | ordered.append(notes_git_dir.resolve()) |
| 481 | ordered.extend(path.resolve() for path in notes_git_dir.glob("Deep Reading - *") if path.is_dir()) |
| 482 | ordered.extend([fallback, legacy_exports]) |
| 483 | results: List[Path] = [] |
| 484 | seen: Set[str] = set() |
| 485 | for candidate in ordered: |
| 486 | key = str(candidate) |
| 487 | if key in seen: |
| 488 | continue |
| 489 | seen.add(key) |
| 490 | if candidate.exists() and candidate.is_dir(): |
| 491 | results.append(candidate) |
| 492 | if not results: |
| 493 | results.append(configured) |
| 494 | return results |
| 495 | |
| 496 | |
| 497 | def _report_id(path: Path) -> str: |
no test coverage detected