mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Add year to book model
This commit is contained in:
@@ -75,6 +75,7 @@ pub struct RemoteBook {
|
||||
pub title: String,
|
||||
pub lang: String,
|
||||
pub file_type: String,
|
||||
pub year: i32,
|
||||
pub available_types: Vec<String>,
|
||||
pub uploaded: String,
|
||||
pub authors: Vec<Author>,
|
||||
@@ -92,6 +93,7 @@ impl From<book::Data> for RemoteBook {
|
||||
title,
|
||||
lang,
|
||||
file_type,
|
||||
year,
|
||||
uploaded,
|
||||
book_authors,
|
||||
translations,
|
||||
@@ -107,6 +109,7 @@ impl From<book::Data> for RemoteBook {
|
||||
title,
|
||||
lang,
|
||||
file_type: file_type.clone(),
|
||||
year,
|
||||
available_types: get_available_types(file_type, source.clone().unwrap().name),
|
||||
uploaded: uploaded.format("%Y-%m-%d").to_string(),
|
||||
authors: get_authors(book_authors),
|
||||
@@ -147,6 +150,7 @@ pub struct DetailBook {
|
||||
pub title: String,
|
||||
pub lang: String,
|
||||
pub file_type: String,
|
||||
pub year: i32,
|
||||
pub available_types: Vec<String>,
|
||||
pub uploaded: String,
|
||||
pub authors: Vec<Author>,
|
||||
@@ -167,6 +171,7 @@ impl From<book::Data> for DetailBook {
|
||||
title,
|
||||
lang,
|
||||
file_type,
|
||||
year,
|
||||
uploaded,
|
||||
book_authors,
|
||||
translations,
|
||||
@@ -185,6 +190,7 @@ impl From<book::Data> for DetailBook {
|
||||
title,
|
||||
lang,
|
||||
file_type: file_type.clone(),
|
||||
year,
|
||||
available_types: get_available_types(file_type, source.clone().unwrap().name),
|
||||
uploaded: uploaded.format("%Y-%m-%d").to_string(),
|
||||
authors: get_authors(book_authors),
|
||||
@@ -212,6 +218,7 @@ pub struct Book {
|
||||
pub title: String,
|
||||
pub lang: String,
|
||||
pub file_type: String,
|
||||
pub year: i32,
|
||||
pub available_types: Vec<String>,
|
||||
pub uploaded: String,
|
||||
pub authors: Vec<Author>,
|
||||
@@ -227,6 +234,7 @@ impl From<book::Data> for Book {
|
||||
title,
|
||||
lang,
|
||||
file_type,
|
||||
year,
|
||||
uploaded,
|
||||
book_authors,
|
||||
translations,
|
||||
@@ -241,6 +249,7 @@ impl From<book::Data> for Book {
|
||||
title,
|
||||
lang,
|
||||
file_type: file_type.clone(),
|
||||
year,
|
||||
available_types: get_available_types(file_type, source.clone().unwrap().name),
|
||||
uploaded: uploaded.format("%Y-%m-%d").to_string(),
|
||||
authors: get_authors(book_authors),
|
||||
|
||||
Reference in New Issue
Block a user