#pragma once
#include "Book.hpp"
#include <string>
#include <optional>

/// Result payload returned by import helpers.
struct ImportResult {
  std::string title;
  std::string author;
  std::string coverPngPath; // path to extracted/ rendered PNG (empty if none)
};

/// Ensure ~/.local/share/bibliotheca/covers exists, return path to it.
std::string ensure_covers_dir();

/// Given a file path + precomputed book id (sha256 hex),
/// extract metadata and render/ extract a cover into covers dir.
/// Returns ImportResult on success (may have empty fields).
std::optional<ImportResult> import_book_assets(const std::string& filePath,
                                               const std::string& bookIdHex);
