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