wip
This commit is contained in:
@@ -121,6 +121,7 @@ final class CanonicalStadium {
|
||||
var yearOpened: Int?
|
||||
var imageURL: String?
|
||||
var sport: String
|
||||
var timezoneIdentifier: String?
|
||||
|
||||
// User-correctable fields (preserved during sync)
|
||||
var userNickname: String?
|
||||
@@ -145,7 +146,8 @@ final class CanonicalStadium {
|
||||
capacity: Int,
|
||||
yearOpened: Int? = nil,
|
||||
imageURL: String? = nil,
|
||||
sport: String
|
||||
sport: String,
|
||||
timezoneIdentifier: String? = nil
|
||||
) {
|
||||
self.canonicalId = canonicalId
|
||||
self.uuid = uuid ?? Self.deterministicUUID(from: canonicalId)
|
||||
@@ -161,6 +163,7 @@ final class CanonicalStadium {
|
||||
self.yearOpened = yearOpened
|
||||
self.imageURL = imageURL
|
||||
self.sport = sport
|
||||
self.timezoneIdentifier = timezoneIdentifier
|
||||
}
|
||||
|
||||
var source: DataSource {
|
||||
@@ -181,7 +184,8 @@ final class CanonicalStadium {
|
||||
capacity: capacity,
|
||||
sport: Sport(rawValue: sport) ?? .mlb,
|
||||
yearOpened: yearOpened,
|
||||
imageURL: imageURL.flatMap { URL(string: $0) }
|
||||
imageURL: imageURL.flatMap { URL(string: $0) },
|
||||
timeZoneIdentifier: timezoneIdentifier
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ actor BootstrapService {
|
||||
let sport: String
|
||||
let primary_team_abbrevs: [String]
|
||||
let year_opened: Int?
|
||||
let timezone_identifier: String?
|
||||
}
|
||||
|
||||
private struct JSONCanonicalTeam: Codable {
|
||||
@@ -71,7 +72,7 @@ actor BootstrapService {
|
||||
let away_team_canonical_id: String
|
||||
let stadium_canonical_id: String
|
||||
let is_playoff: Bool
|
||||
let broadcast: String?
|
||||
let broadcast_info: String?
|
||||
}
|
||||
|
||||
private struct JSONStadiumAlias: Codable {
|
||||
@@ -214,7 +215,8 @@ actor BootstrapService {
|
||||
longitude: jsonStadium.longitude,
|
||||
capacity: jsonStadium.capacity,
|
||||
yearOpened: jsonStadium.year_opened,
|
||||
sport: jsonStadium.sport
|
||||
sport: jsonStadium.sport,
|
||||
timezoneIdentifier: jsonStadium.timezone_identifier
|
||||
)
|
||||
context.insert(canonical)
|
||||
}
|
||||
@@ -437,7 +439,7 @@ actor BootstrapService {
|
||||
sport: jsonGame.sport,
|
||||
season: jsonGame.season,
|
||||
isPlayoff: jsonGame.is_playoff,
|
||||
broadcastInfo: jsonGame.broadcast
|
||||
broadcastInfo: jsonGame.broadcast_info
|
||||
)
|
||||
context.insert(game)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user