Handle existing English and Japanese titles but empty
This commit is contained in:
parent
c351c33898
commit
d8268565a4
|
@ -389,7 +389,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nhentairs"
|
name = "nhentairs"
|
||||||
version = "0.5.3"
|
version = "0.5.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "nhentairs"
|
name = "nhentairs"
|
||||||
version = "0.5.3"
|
version = "0.5.4"
|
||||||
authors = ["blank X <theblankx@protonmail.com>"]
|
authors = ["blank X <theblankx@protonmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
|
@ -72,9 +72,9 @@ impl fmt::Display for GalleryInfoSuccess {
|
||||||
let mut text = format!("Sauce: {}\nTitle: ", self.id);
|
let mut text = format!("Sauce: {}\nTitle: ", self.id);
|
||||||
let japanese_title = self.title.japanese.as_ref();
|
let japanese_title = self.title.japanese.as_ref();
|
||||||
let english_title = self.title.english.as_ref();
|
let english_title = self.title.english.as_ref();
|
||||||
if english_title.is_some() {
|
if english_title.filter(|i| !i.is_empty()).is_some() {
|
||||||
text.push_str(english_title.unwrap());
|
text.push_str(english_title.unwrap());
|
||||||
if japanese_title.is_some() {
|
if japanese_title.filter(|i| !i.is_empty()).is_some() {
|
||||||
text.push_str(&format!("\nJapanese Title: {}", japanese_title.unwrap()));
|
text.push_str(&format!("\nJapanese Title: {}", japanese_title.unwrap()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue