Trim spaces on authors and genres

This commit is contained in:
blank X 2021-01-09 22:14:07 +07:00
parent 4271a7bac4
commit c781c62261
3 changed files with 6 additions and 6 deletions

2
Cargo.lock generated
View File

@ -330,7 +330,7 @@ dependencies = [
[[package]]
name = "mangafetchi"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"quick-xml",
"reqwest",

View File

@ -1,6 +1,6 @@
[package]
name = "mangafetchi"
version = "0.1.1"
version = "0.1.2"
authors = ["blank X <theblankx@protonmail.com>"]
edition = "2018"

View File

@ -204,11 +204,11 @@ fn parse_manganelo_manga(text: &str, manga_id: &str) -> structs::MangaOption {
if name.is_none() && is_inside_h1 {
name = Some(text);
} 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 {
status = Some(text);
} 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 {
last_updated = Some(text);
} 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 {
name = Some(text);
} 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 {
genres.push(text);
genres.push(text.trim().to_string());
} else {
match text.splitn(2, ' ').nth(0).unwrap() {
"Author(s)" => is_inside_authors = true,