Skip to content

Commit

Permalink
Use prefix search for additional_prefixes
Browse files Browse the repository at this point in the history
This allows us to add our EDYY stations
  • Loading branch information
Epse committed Feb 5, 2025
1 parent 7ee77cc commit 7b2b0ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/workers/live-stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "../types/cache";
import {APIEmbedField, BaseGuildTextChannel, Client, EmbedBuilder} from "discord.js";
import {makeTimestamp, TimestampFormat} from "../util/timestamp";
import config from "../util/config";
import {call} from "node-stream-zip";

function aggregateAirport(icao: string, data: any): APIEmbedField[] {
const flightPlans = data['pilots'].filter(x => x['flight_plan'] != null).map(x => x['flight_plan']);
Expand Down Expand Up @@ -34,7 +35,7 @@ function aggregateAirport(icao: string, data: any): APIEmbedField[] {
function prefixMatches(callsign: string): boolean {
const prefix = callsign.split('_')[0];
return config.activity.airports.findIndex(x => x === prefix) !== -1
|| config.activity.additional_prefixes.findIndex(x => x === prefix) !== -1;
|| config.activity.additional_prefixes.findIndex(x => callsign.startsWith(x)) !== -1;
}

function getControllerFields(data: any): APIEmbedField[] {
Expand Down

0 comments on commit 7b2b0ac

Please sign in to comment.