mirror of
https://codeberg.org/icewind/ugc-scaper.git
synced 2026-06-03 18:24:10 +02:00
guess region from timezone
This commit is contained in:
parent
2c6264ccf0
commit
cf17647408
4 changed files with 4209 additions and 1 deletions
|
|
@ -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', " ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue