diff options
Diffstat (limited to 'storage.go')
-rw-r--r-- | storage.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -5,6 +5,7 @@ import ( "encoding/hex" "encoding/json" "errors" + "fmt" "io" "io/ioutil" "net/http" @@ -68,6 +69,16 @@ func (s *Storage) AddBattle(battle *Battle) error { return errors.New("missing killmails") } battle.CalculateHash() + killmail := battle.Killmails[0] + details, err := GetKillmail(killmail.Id, killmail.Hash) + if err != nil { + return err + } + system, err := GetSolarSystem(details.SolarSystemId) + if err != nil { + return err + } + battle.Name = fmt.Sprintf("Battle in %s", system.Name) data, err := json.Marshal(battle) if err != nil { return err |