pirxpilot / liftie

:ski: Clean, simple, easy to read, fast ski resort lift status.
https://liftie.info
BSD 3-Clause "New" or "Revised" License
70 stars 32 forks source link

Change JSON Structure #43

Closed 13mralex closed 2 years ago

13mralex commented 2 years ago

My reverse engineering skills aren't the greatest...I am trying to index the lift names and status, but since they aren't numbered, I’m having trouble. Is there a way to change it like described below?

Current:

Screen Shot 2021-12-24 at 10 08 57 PM

Suggested:

Screen Shot 2021-12-24 at 10 10 23 PM

Basically, just have each lift status have its own unique, numbered index rather than the name of the lift be the index.

pirxpilot commented 2 years ago

Changing status format for Liftie server would would break Liftie API. It would mean rewriting all the tests, reworking the web client and it would require changes for all current Liftie API users. Not to mention it would also make status payloads bigger.

I am also not sure what you mean by index the lift names and status

Could you do that with something like:

Object.entries(lifts.status).map(([name, status]) => ({name, status}))