v0.16.0 import PGN, delete games, two-layout web client
test / test (push) Canceled after 0s
test / e2e (push) Canceled after 0s

This commit is contained in:
lixen committed 2026-10-19 21:02:39 -04:00
1 parent e1fa5242e3
commit 664cf9654e
34 files changed
+2007 -150

No files matched your search

+10 -1
View File
@@ -75,9 +75,18 @@ func BuildPGN(record *storage.GameRecord, moves []storage.MoveRecord, ply int) (
}
}
start := record.StartTimeUTC.UTC()
event, site, round := "Casual game", "", ""
if record.ImportedBy != "" {
event, site, round = record.Event, record.Site, record.Round
if event == "" {
event = "Imported game"
}
}
tags := []chess.Tag{
{Name: "Event", Value: "Casual game"},
{Name: "Event", Value: event},
{Name: "Site", Value: site},
{Name: "Date", Value: start.Format("2006.01.02")},
{Name: "Round", Value: round},
{Name: "White", Value: playerName(record.WhiteType, record.WhiteLevel, record.WhiteName)},
{Name: "Black", Value: playerName(record.BlackType, record.BlackLevel, record.BlackName)},
{Name: "GameId", Value: record.GameID},