This commit is contained in:
2023-08-09 16:30:55 +02:00
parent 8a1c525a78
commit 32808f9006
2 changed files with 6 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ use serde::Deserialize;
#[derive(Deserialize, Debug, Clone)] #[derive(Deserialize, Debug, Clone)]
pub struct Source { pub struct Source {
// id: u32, pub id: u32,
// name: String // name: String
} }
@@ -23,6 +23,7 @@ pub struct Book {
pub file_type: String, pub file_type: String,
pub uploaded: String, pub uploaded: String,
pub authors: Vec<BookAuthor>, pub authors: Vec<BookAuthor>,
pub source: Source,
} }
#[derive(Deserialize, Debug, Clone)] #[derive(Deserialize, Debug, Clone)]
@@ -34,6 +35,7 @@ pub struct BookWithRemote {
pub file_type: String, pub file_type: String,
pub uploaded: String, pub uploaded: String,
pub authors: Vec<BookAuthor>, pub authors: Vec<BookAuthor>,
pub source: Source,
} }
#[derive(Deserialize, Debug, Clone)] #[derive(Deserialize, Debug, Clone)]
@@ -51,7 +53,8 @@ impl BookWithRemote {
lang: book.lang, lang: book.lang,
file_type: book.file_type, file_type: book.file_type,
uploaded: book.uploaded, uploaded: book.uploaded,
authors: book.authors authors: book.authors,
source: book.source,
} }
} }
} }

View File

@@ -42,7 +42,7 @@ pub async fn cache_file(
}; };
let downloader_result = match download_from_downloader( let downloader_result = match download_from_downloader(
book.remote_id, book.source.id,
object_id, object_id,
object_type.clone() object_type.clone()
).await { ).await {