EDSM-NET / FrontEnd

Issues tracker for EDSM
https://www.edsm.net/
37 stars 0 forks source link

Trappist-1 main star has null id64 value #506

Open sentrychris opened 1 year ago

sentrychris commented 1 year ago

Forgive me if this is the wrong place for this kind of issue. I'm building a personal tool using data from EDSM, primarily just for educational purposes, however while requesting system bodies from EDSM via the API, I encountered a celestial body that doesn't have an id64 value.

Here is the particular celestial body in the response from https://www.edsm.net/api-system-v1/bodies?systemName=Trappist-1:

{
  "id": 56283510,
  "id64": null,
  "bodyId": null,
  "name": "Trappist-1",
  "discovery": {
      "commander": "Taimaru",
      "date": "2017-04-11 17:45:43"
  },
  "type": "Star",
  "subType": "M (Red dwarf) Star",
  "parents": null,
  "distanceToArrival": 0,
  "isMainStar": true,
  "isScoopable": true,
  "age": 12648,
  "spectralClass": "M6",
  "luminosity": "V",
  "absoluteMagnitude": 14.775818,
  "solarMasses": 0.078125,
  "solarRadius": 0.11398314881380302,
  "surfaceTemperature": 2600,
  "orbitalPeriod": null,
  "semiMajorAxis": null,
  "orbitalEccentricity": null,
  "orbitalInclination": null,
  "argOfPeriapsis": null,
  "rotationalPeriod": 1.4000000105092594,
  "rotationalPeriodTidallyLocked": false,
  "axialTilt": 0,
  "updateTime": "2020-12-23 09:49:41"
},

Based on Spansh's data, I assume it should be the same as the system: 5364950911832.

klightspeed commented 1 year ago

The main star should have BodyID=0, but in this case BodyID is null.

https://github.com/EDSM-NET/EDDN-Events/blob/e47802a77ad3982eec930a34cb6de50e73de39e0/System/Body.php#L263

                    if(!array_key_exists('id64', $currentBodyData) || $currentBodyData['id64'] != $message['BodyID'])

That != probably should be !==

php > var_dump(0 != null);
bool(false)
php > var_dump(0 !== null);
bool(true)