fix teams with no timezone

This commit is contained in:
Robin Appelman 2023-11-27 21:51:04 +01:00
commit 1a997aef36
9 changed files with 3043 additions and 13 deletions

View file

@ -90,7 +90,7 @@ pub struct Team {
pub tag: String,
pub image: String,
pub format: String,
pub timezone: String,
pub timezone: Option<String>,
pub division: String,
pub description: String,
pub titles: Vec<String>,

View file

@ -154,12 +154,7 @@ impl Parser for TeamParser {
})?
.to_string();
let timezone = select_text(root, &self.selector_team_timezone)
.ok_or(ParseError::ElementNotFound {
selector: SELECTOR_TEAM_TIMEZONE,
role: "team timzone",
})?
.to_string();
let timezone = select_text(root, &self.selector_team_timezone).map(String::from);
let description = select_text(root, &self.selector_team_description)
.unwrap_or_default()