wiedehopf / tar1090

Provides an improved webinterface for use with ADS-B decoders readsb / dump1090-fa
Other
1.21k stars 222 forks source link

Add route lookup via adsbdb.com #231

Closed dirkhh closed 1 year ago

dirkhh commented 1 year ago

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).

dirkhh commented 1 year ago

Given the feedback regarding the amount of API requests this can create, I think I may redesign this to work differently. Let's pause here for a moment while I find time to study this a bit more.

dirkhh commented 1 year ago

replaced by #232