Don't show chapters with empty chapter numbers and bump tokio version
This commit is contained in:
parent
27c8c76dfe
commit
0d3fde7d47
|
@ -338,7 +338,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "mangadexrs"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"quick-xml",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "mangadexrs"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
authors = ["blank X <theblankx@protonmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
|
@ -10,7 +10,7 @@ edition = "2018"
|
|||
lto = true
|
||||
|
||||
[dependencies]
|
||||
tokio = { version = "1.1", features = ["rt-multi-thread"] }
|
||||
tokio = { version = "1.2", features = ["rt-multi-thread"] }
|
||||
reqwest = "0.11"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
|
|
|
@ -17,7 +17,9 @@ pub async fn get_manga(client: reqwest::Client, id: i32) -> Result<Option<struct
|
|||
return Ok(None);
|
||||
}
|
||||
resp.error_for_status_ref()?;
|
||||
Ok(Some(serde_json::from_str(&resp.text().await?)?))
|
||||
let mut manga: structs::Manga = serde_json::from_str(&resp.text().await?)?;
|
||||
manga.data.chapters.retain(|i| !i.chapter.is_empty());
|
||||
Ok(Some(manga))
|
||||
}
|
||||
|
||||
pub async fn get_chapter(client: reqwest::Client, chapter: i32) -> Result<Option<structs::Chapter>, structs::Error> {
|
||||
|
|
Loading…
Reference in New Issue