guess region from timezone

This commit is contained in:
Robin Appelman 2025-04-15 21:33:43 +02:00
commit cf17647408
4 changed files with 4209 additions and 1 deletions

View file

@ -177,7 +177,7 @@ impl Parser for TeamParser {
})?
.to_string();
let region = division
let mut region = division
.split(' ')
.find_map(|part| Region::from_str(part).ok())
.or_else(|| Region::from_str(division.trim_end_matches("New Teams").trim()).ok())
@ -185,6 +185,12 @@ impl Parser for TeamParser {
let timezone = select_text(root, &self.selector_team_timezone).map(String::from);
if let Some(timezone) = timezone.as_deref() {
if region.is_none() {
region = Region::from_str(timezone).ok();
}
}
let description = select_text(root, &self.selector_team_description)
.unwrap_or_default()
.replace('\n', " ");