spotters: stricter logo checks (no photos, plates, insignia or old names; --recheck), planes operator bonus weighted down for historic types, Türkiye for iNat
All checks were successful
Deploy production / deploy (push) Successful in 1m9s
All checks were successful
Deploy production / deploy (push) Successful in 1m9s
This commit is contained in:
@@ -193,8 +193,10 @@ async function planes() {
|
||||
makers: string[];
|
||||
icao: string[];
|
||||
wikidata: string;
|
||||
current: boolean;
|
||||
}[]
|
||||
>`select t.id, t.family_id as family, t.name, m.name as maker, t.makers, t.icao, t.wikidata
|
||||
>`select t.id, t.family_id as family, t.name, m.name as maker, t.makers, t.icao, t.wikidata,
|
||||
(t.status in ('in service', 'in production') or (t.retired_year is null and coalesce(t.introduced_year, t.first_flight_year, 0) >= 1960)) as current
|
||||
from planes.types t join planes.makers m on m.id = t.maker_id`;
|
||||
|
||||
// Candidate keys per maker word: the type's name, without generic words, and its
|
||||
@@ -346,14 +348,18 @@ async function planes() {
|
||||
isoOf.set(op, set);
|
||||
}
|
||||
}
|
||||
// Historic operators (a 1918 air force flying the DH.9) say little about what you can
|
||||
// spot today: types that are retired or older than 1960 get a fifth of the bonus.
|
||||
const current = new Map(types.map((t) => [t.id, t.current]));
|
||||
for (const [item, opSet] of opsOf) {
|
||||
const id = byQid.get(item);
|
||||
if (!id) continue;
|
||||
const weight = current.get(id) ? 25 : 5;
|
||||
const perCountry = new Map<string, number>();
|
||||
for (const op of opSet)
|
||||
for (const cc of isoOf.get(op) ?? []) perCountry.set(cc, (perCountry.get(cc) ?? 0) + 1);
|
||||
for (const [cc, n] of perCountry) {
|
||||
add(scores, id, cc, 25 * Math.min(n, 6));
|
||||
add(scores, id, cc, weight * Math.min(n, 6));
|
||||
ops++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user