Initial commit

This commit is contained in:
2025-09-08 14:10:52 +03:00
commit 96f15ab51e
24 changed files with 1848 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
use crate::domain::author::Author;
use crate::domain::book::Book;
use std::path::PathBuf;
pub fn parse(path: &PathBuf) -> Result<Book, String> {
let mut book = Book::new();
book.title = path.to_string_lossy().to_string();
let mut author = Author::new();
author.first_name = path.extension().unwrap().to_string_lossy().to_string();
book.author.push(author);
return Ok(book);
}