feat: Add zip parser

ref: Parsers now returns vector, not a single book
This commit is contained in:
2025-09-09 11:00:27 +03:00
parent c86be31d54
commit a71ce6d26f
8 changed files with 497 additions and 18 deletions

View File

@@ -2,7 +2,7 @@ use crate::domain::author::Author;
use crate::domain::book::Book;
use std::path::PathBuf;
pub fn parse(path: &PathBuf) -> Result<Book, String> {
pub fn parse(path: &PathBuf) -> Result<Vec<Book>, String> {
let mut book = Book::new();
book.title = path.to_string_lossy().to_string();
@@ -11,5 +11,5 @@ pub fn parse(path: &PathBuf) -> Result<Book, String> {
author.first_name = path.extension().unwrap().to_string_lossy().to_string();
book.author.push(author);
return Ok(book);
return Ok(vec![ book]);
}