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]]
|
[[package]]
|
||||||
name = "mangadexrs"
|
name = "mangadexrs"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "mangadexrs"
|
name = "mangadexrs"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
authors = ["blank X <theblankx@protonmail.com>"]
|
authors = ["blank X <theblankx@protonmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ edition = "2018"
|
||||||
lto = true
|
lto = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tokio = { version = "1.1", features = ["rt-multi-thread"] }
|
tokio = { version = "1.2", features = ["rt-multi-thread"] }
|
||||||
reqwest = "0.11"
|
reqwest = "0.11"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
|
@ -17,7 +17,9 @@ pub async fn get_manga(client: reqwest::Client, id: i32) -> Result<Option<struct
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
resp.error_for_status_ref()?;
|
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> {
|
pub async fn get_chapter(client: reqwest::Client, chapter: i32) -> Result<Option<structs::Chapter>, structs::Error> {
|
||||||
|
|
Loading…
Reference in New Issue