fix(data): populate stadium timezone in scrapers and CloudKit sync

Stadium timezones were always null because scrapers weren't passing
the timezone from STADIUM_MAPPINGS to the Stadium constructor. This
fix propagates timezone data through the entire pipeline: scrapers,
CloudKit uploader, and Swift CloudKit model.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-20 22:45:30 -06:00
parent 166ad5d6f9
commit 12ddca4d10
9 changed files with 13 additions and 1 deletions

View File

@@ -119,6 +119,7 @@ struct CKStadium {
static let yearOpenedKey = "yearOpened"
static let imageURLKey = "imageURL"
static let sportKey = "sport"
static let timezoneIdentifierKey = "timezoneIdentifier"
let record: CKRecord
@@ -160,6 +161,7 @@ struct CKStadium {
let imageURL = (record[CKStadium.imageURLKey] as? String).flatMap { URL(string: $0) }
let sportRaw = record[CKStadium.sportKey] as? String ?? "MLB"
let sport = Sport(rawValue: sportRaw) ?? .mlb
let timezoneIdentifier = record[CKStadium.timezoneIdentifierKey] as? String
return Stadium(
id: id,
@@ -171,7 +173,8 @@ struct CKStadium {
capacity: capacity,
sport: sport,
yearOpened: record[CKStadium.yearOpenedKey] as? Int,
imageURL: imageURL
imageURL: imageURL,
timeZoneIdentifier: timezoneIdentifier
)
}
}