Skip to content

Commit

Permalink
feat: add the missing languages
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrielFR committed Apr 2, 2022
1 parent 9f1c9ef commit 573add8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// #![deny(missing_docs)]
#![allow(clippy::field_reassign_with_default)]
#![allow(clippy::let_and_return)]
#![allow(clippy::let_and_return)] // TODO: Remove this
#![allow(dead_code)] // TODO: Remove this
#![allow(unused_mut)] // TODO: Remove this
#![allow(unused_variables)] // TODO: Remove this
Expand Down
36 changes: 28 additions & 8 deletions src/models/anime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,34 @@ impl Anime {
_ => Some(LinkType::default()),
},
language: match external_link["language"].as_str() {
Some(language) => {
// TODO: Add rest
match language {
"ENGLISH" => Some(Language::English),
"KOREAN" => Some(Language::Korean),
_ => Some(Language::default()),
}
}
Some(language) => match language.to_uppercase().as_str() {
"ENGLISH" => Some(Language::English),
"KOREAN" => Some(Language::Korean),
"ITALIAN" => Some(Language::Italian),
"SPANISH" => Some(Language::Spanish),
"PORTUGUESE" => Some(Language::Portuguese),
"FRENCH" => Some(Language::French),
"GERMAN" => Some(Language::German),
"HEBREW" => Some(Language::Hebrew),
"HUNGARIAN" => Some(Language::Hungarian),
"CHINESE" => Some(Language::Chinese),
"ARABIC" => Some(Language::Arabic),
"FILIPINO" => Some(Language::Filipino),
"CATALAN" => Some(Language::Catalan),
"FINNISH" => Some(Language::Finnish),
"TURKISH" => Some(Language::Turkish),
"DUTCH" => Some(Language::Dutch),
"SWEDISH" => Some(Language::Swedish),
"THAI" => Some(Language::Thai),
"TAGALOG" => Some(Language::Tagalog),
"MALAYSIAN" => Some(Language::Malaysian),
"INDONESIAN" => Some(Language::Indonesian),
"VIETNAMESE" => Some(Language::Vietnamese),
"NEPALI" => Some(Language::Nepali),
"HINDI" => Some(Language::Hindi),
"URDU" => Some(Language::Urdu),
_ => Some(Language::default()),
},
None => None,
},
color: external_link["color"]
Expand Down
36 changes: 28 additions & 8 deletions src/models/manga.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,34 @@ impl Manga {
_ => Some(LinkType::default()),
},
language: match external_link["language"].as_str() {
Some(language) => {
// TODO: Add rest
match language {
"ENGLISH" => Some(Language::English),
"KOREAN" => Some(Language::Korean),
_ => Some(Language::default()),
}
}
Some(language) => match language.to_uppercase().as_str() {
"ENGLISH" => Some(Language::English),
"KOREAN" => Some(Language::Korean),
"ITALIAN" => Some(Language::Italian),
"SPANISH" => Some(Language::Spanish),
"PORTUGUESE" => Some(Language::Portuguese),
"FRENCH" => Some(Language::French),
"GERMAN" => Some(Language::German),
"HEBREW" => Some(Language::Hebrew),
"HUNGARIAN" => Some(Language::Hungarian),
"CHINESE" => Some(Language::Chinese),
"ARABIC" => Some(Language::Arabic),
"FILIPINO" => Some(Language::Filipino),
"CATALAN" => Some(Language::Catalan),
"FINNISH" => Some(Language::Finnish),
"TURKISH" => Some(Language::Turkish),
"DUTCH" => Some(Language::Dutch),
"SWEDISH" => Some(Language::Swedish),
"THAI" => Some(Language::Thai),
"TAGALOG" => Some(Language::Tagalog),
"MALAYSIAN" => Some(Language::Malaysian),
"INDONESIAN" => Some(Language::Indonesian),
"VIETNAMESE" => Some(Language::Vietnamese),
"NEPALI" => Some(Language::Nepali),
"HINDI" => Some(Language::Hindi),
"URDU" => Some(Language::Urdu),
_ => Some(Language::default()),
},
None => None,
},
color: external_link["color"]
Expand Down

0 comments on commit 573add8

Please sign in to comment.