Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a rate limiting library and a reference to axios in order to easily and cleanly allow API accesses without exceeding the rate limits of the API provider. The way this was done might be a bit inconsistent given that for example jQuery is simply copied into this source base.
Once the app receives a callsign for a flight (and that is different from the registration - as asdbdb doesn't track 'live flight plans') it checks if there is already route information for this flight cached and if not it makes an API call to adsbdb.com to look up the origin and destination of that flight.
The code tries to be very careful not to run afoul of the rate limit of that free site - right now this is hopefully conservative enough that even people running a couple of different tar1090 instances won't get in trouble - but one can create a scenario where power users with many windows open might still end up with too many API requests.
As a workaround for people who intentionally keep many parallel instances open there is a config option to turn the route lookup off (right now it is turned on by default).