INNER CODE UNIT · Rust

get_user_novels_dir

mouseart2025/AI-Reader-V2 · frontend/src-tauri/src/lib.rs:276

fn get_user_novels_dir(app: tauri::AppHandle) -> Result<String, String> {
  let data_dir = app
    .path()
    .app_data_dir()
    .map_err(|e| format!("获取数据目录失败: {e}"))?;
  let novels_dir = data_dir.join("novels");
  Ok(novels_dir.to_string_lossy().to_string())
}

// ── .air Preview & Import ────────────────────────

#[derive(Serialize)]
struct PreviewResult {
  title: String,
  author: Option<String>,
  total_chapters: usize,
  total_words: u64,
  analyzed_chapters: usize,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…