fix: Minor bugfix

This commit is contained in:
2025-09-09 22:50:42 +03:00
parent 4a7ed0974c
commit ec8cc12bf8
2 changed files with 5 additions and 1 deletions

View File

@@ -70,7 +70,10 @@ impl Books {
pub fn add_books_from_path(&mut self) {
let books = fs::Loader::new(PathBuf::from(&self.root))
.into_iter()
.map(|mut book| {book.source = book.source.strip_prefix(&self.root).unwrap().into(); book})
.map(|mut book| {match book.source.strip_prefix(&self.root) {
Ok(path) => book.source = path.to_path_buf(),
Err(err) => eprintln!("strip source prefix: {}", err)
}; book})
.collect();
match self.repo.lock() {