Trim spaces on authors and genres
This commit is contained in:
parent
4271a7bac4
commit
c781c62261
|
@ -330,7 +330,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mangafetchi"
|
name = "mangafetchi"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "mangafetchi"
|
name = "mangafetchi"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
authors = ["blank X <theblankx@protonmail.com>"]
|
authors = ["blank X <theblankx@protonmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
|
@ -204,11 +204,11 @@ fn parse_manganelo_manga(text: &str, manga_id: &str) -> structs::MangaOption {
|
||||||
if name.is_none() && is_inside_h1 {
|
if name.is_none() && is_inside_h1 {
|
||||||
name = Some(text);
|
name = Some(text);
|
||||||
} else if is_inside_authors && is_inside_td && is_inside_a {
|
} else if is_inside_authors && is_inside_td && is_inside_a {
|
||||||
authors.push(text);
|
authors.push(text.trim().to_string());
|
||||||
} else if is_inside_status && is_inside_td {
|
} else if is_inside_status && is_inside_td {
|
||||||
status = Some(text);
|
status = Some(text);
|
||||||
} else if is_inside_genres && is_inside_td && is_inside_a {
|
} else if is_inside_genres && is_inside_td && is_inside_a {
|
||||||
genres.push(text);
|
genres.push(text.trim().to_string());
|
||||||
} else if last_updated.is_none() && is_inside_stre_value {
|
} else if last_updated.is_none() && is_inside_stre_value {
|
||||||
last_updated = Some(text);
|
last_updated = Some(text);
|
||||||
} else if is_inside_description && !is_inside_h3 {
|
} else if is_inside_description && !is_inside_h3 {
|
||||||
|
@ -364,9 +364,9 @@ fn parse_mangakakalot_manga(text: &str, manga_id: &str) -> structs::MangaOption
|
||||||
if is_inside_h1 {
|
if is_inside_h1 {
|
||||||
name = Some(text);
|
name = Some(text);
|
||||||
} else if is_inside_authors && is_inside_a {
|
} else if is_inside_authors && is_inside_a {
|
||||||
authors.push(text);
|
authors.push(text.trim().to_string());
|
||||||
} else if is_inside_genres && is_inside_a {
|
} else if is_inside_genres && is_inside_a {
|
||||||
genres.push(text);
|
genres.push(text.trim().to_string());
|
||||||
} else {
|
} else {
|
||||||
match text.splitn(2, ' ').nth(0).unwrap() {
|
match text.splitn(2, ' ').nth(0).unwrap() {
|
||||||
"Author(s)" => is_inside_authors = true,
|
"Author(s)" => is_inside_authors = true,
|
||||||
|
|
Loading…
Reference in New Issue