diff --git a/src/services/book_library/types.rs b/src/services/book_library/types.rs index 4edd9a1..181b943 100644 --- a/src/services/book_library/types.rs +++ b/src/services/book_library/types.rs @@ -3,7 +3,7 @@ use serde::Deserialize; #[derive(Deserialize, Debug, Clone)] pub struct Source { - // id: u32, + pub id: u32, // name: String } @@ -23,6 +23,7 @@ pub struct Book { pub file_type: String, pub uploaded: String, pub authors: Vec, + pub source: Source, } #[derive(Deserialize, Debug, Clone)] @@ -34,6 +35,7 @@ pub struct BookWithRemote { pub file_type: String, pub uploaded: String, pub authors: Vec, + pub source: Source, } #[derive(Deserialize, Debug, Clone)] @@ -51,7 +53,8 @@ impl BookWithRemote { lang: book.lang, file_type: book.file_type, uploaded: book.uploaded, - authors: book.authors + authors: book.authors, + source: book.source, } } } diff --git a/src/services/mod.rs b/src/services/mod.rs index be2f7e3..29bfea6 100644 --- a/src/services/mod.rs +++ b/src/services/mod.rs @@ -42,7 +42,7 @@ pub async fn cache_file( }; let downloader_result = match download_from_downloader( - book.remote_id, + book.source.id, object_id, object_type.clone() ).await {