Refactor: Simplify case directory structure

The distinction between `open/` and `done/` directories for cases has
been removed.
All cases for a user now reside directly under the user's directory
(e.g., `<data_path>/<slug>/<case_id>/`).

This simplifies path management and eliminates redundant directory
traversals.

Key changes include:
- Removed `open/` and `done/` subdirectories in path resolution.
- Introduced a `paths::case_dir` function as a single source of truth
  for case directory layout.
- Updated various modules (`recovery`, `auth`, `routes`, `transcribe`,
  `tests`) to use the new path structure.
- Adjusted templates to reflect the simplified case status
  representation.
This commit is contained in:
2026-04-15 22:15:13 +02:00
parent 70eed20909
commit 11eb645f3f
17 changed files with 190 additions and 324 deletions
+2 -3
View File
@@ -4,7 +4,7 @@ use tracing::{info, warn};
use super::{AnalyzeJob, AnalyzeSender};
/// Walk `data_path/*/open/*/analysis_input_v*.json` and enqueue every input
/// Walk `data_path/*/*/analysis_input_v*.json` and enqueue every input
/// that does not yet have a matching `document_v*.md` sibling.
///
/// Intended to run once at startup. Send is synchronous on the unbounded
@@ -33,8 +33,7 @@ async fn collect_pending(data_path: &Path) -> Vec<(PathBuf, u32)> {
};
while let Ok(Some(user_entry)) = users.next_entry().await {
let open_dir = user_entry.path().join("open");
let mut cases = match tokio::fs::read_dir(&open_dir).await {
let mut cases = match tokio::fs::read_dir(user_entry.path()).await {
Ok(r) => r,
Err(_) => continue,
};