From 488551e9146444c4265fe564e562037df24adf46 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Wed, 13 Nov 2024 10:22:42 +0000 Subject: [PATCH] Fix PIS 'toc' and remove deduplication step --- helpers/config.go | 2 +- pis/data.go | 5 +++-- pis/types.go | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/helpers/config.go b/helpers/config.go index c5a759d..eb8f8f2 100644 --- a/helpers/config.go +++ b/helpers/config.go @@ -5,7 +5,7 @@ import ( ) // Version Constants -const versionNum string = "2024.11.3" +const versionNum string = "2024.11.4" const versionSuffix string = "" const Version string = versionNum + versionSuffix diff --git a/pis/data.go b/pis/data.go index 6408c75..5a5e7e8 100644 --- a/pis/data.go +++ b/pis/data.go @@ -25,12 +25,13 @@ func processYaml(yamlStr string) (*[]database.PIS, error) { return nil, fmt.Errorf("failed to unmarshal YAML: %v", err) } + /* DISABLE DEDUPLICATION - Add 'dupe' flag and have backend handle duplicates? // Perform deduplication on the entire pis slice err = deduplicateCodes(&pisData.Pis) if err != nil { return nil, err } - + */ documents, err := convertPisForDatabase(&pisData.Pis) if err != nil { return nil, err @@ -71,7 +72,7 @@ func convertPisForDatabase(in *[]PisData) (*[]database.PIS, error) { for _, code := range *in { var document database.PIS document.Code = code.Code - document.Operator = code.Operator + document.Operator = code.Toc document.Stops = code.Stops document.Tiplocs = GetTiplocsFromCrs(code.Stops) diff --git a/pis/types.go b/pis/types.go index 2f57b4f..9e1be1e 100644 --- a/pis/types.go +++ b/pis/types.go @@ -9,7 +9,7 @@ type GiteaReleaseData struct { } type PisData struct { - Code string `json:"code"` - Stops []string `json:"stops"` - Operator string `json:"operator"` + Code string `json:"code"` + Stops []string `json:"stops"` + Toc string `json:"toc"` }