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