ADSB enrichment
This commit is contained in:
@@ -81,8 +81,10 @@ export function decodeFlags(f) {
|
||||
};
|
||||
}
|
||||
|
||||
const lookupAircraft = (icao) =>
|
||||
db?.prepare(`SELECT icao, reg, type_code, flags, desc FROM aircraft WHERE icao = ?`).get(icao.toUpperCase());
|
||||
const lookupAircraft = (icao) => {
|
||||
const clean = icao.replace(/^~/, '').toUpperCase().padStart(6, '0');
|
||||
return db?.prepare(`SELECT icao, reg, type_code, flags, desc FROM aircraft WHERE icao = ?`).get(clean);
|
||||
}
|
||||
|
||||
export function enrichAircraft(a) {
|
||||
if(!a.hex) return a;
|
||||
|
||||
Reference in New Issue
Block a user