|
|
|
@ -603,6 +603,13 @@ defer { |
|
|
|
teamScoreOne.score = matchDescriptor.teamOneScores.joined(separator: ",") |
|
|
|
teamScoreOne.score = matchDescriptor.teamOneScores.joined(separator: ",") |
|
|
|
let teamScoreTwo = teamScore(.two) ?? TeamScore(match: id, team: team(.two)) |
|
|
|
let teamScoreTwo = teamScore(.two) ?? TeamScore(match: id, team: team(.two)) |
|
|
|
teamScoreTwo.score = matchDescriptor.teamTwoScores.joined(separator: ",") |
|
|
|
teamScoreTwo.score = matchDescriptor.teamTwoScores.joined(separator: ",") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if matchDescriptor.teamOneScores.last?.contains("-") == true && matchDescriptor.teamTwoScores.last?.contains("-") == false { |
|
|
|
|
|
|
|
teamScoreTwo.score = (matchDescriptor.teamTwoScores.dropLast() + [matchDescriptor.teamTwoScores.last! + "-0"]).joined(separator: ",") |
|
|
|
|
|
|
|
} else if matchDescriptor.teamTwoScores.last?.contains("-") == true && matchDescriptor.teamOneScores.last?.contains("-") == false { |
|
|
|
|
|
|
|
teamScoreOne.score = (matchDescriptor.teamOneScores.dropLast() + [matchDescriptor.teamOneScores.last! + "-0"]).joined(separator: ",") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
do { |
|
|
|
do { |
|
|
|
try self.tournamentStore.teamScores.addOrUpdate(contentOfs: [teamScoreOne, teamScoreTwo]) |
|
|
|
try self.tournamentStore.teamScores.addOrUpdate(contentOfs: [teamScoreOne, teamScoreTwo]) |
|
|
|
} catch { |
|
|
|
} catch { |
|
|
|
|