Skip to content

Commit

Permalink
fix: this/the next train will divide at
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Jan 16, 2024
1 parent 10585a2 commit b609208
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/announcement-data/systems/stations/AmeyPhil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4006,6 +4006,7 @@ export default class AmeyPhil extends StationAnnouncementSystem {
callingPoints: CallingAtPoint[],
terminatingStation: string,
overallLength: number | null,
arriving: boolean,
): Promise<AudioItem[]> {
const files: AudioItem[] = []

Expand Down Expand Up @@ -4139,7 +4140,10 @@ export default class AmeyPhil extends StationAnnouncementSystem {
switch (splitData.divideType) {
case 'splitTerminates':
case 'splits':
files.push({ id: 's.this train will divide at', opts: { delayStart: 200 } }, `station.e.${splitPoint.crsCode}`)
files.push(
{ id: `s.${arriving ? 'this' : 'the next'} train will divide at`, opts: { delayStart: 200 } },
`station.e.${splitPoint.crsCode}`,
)
break
}

Expand All @@ -4150,10 +4154,11 @@ export default class AmeyPhil extends StationAnnouncementSystem {
callingPoints: CallingAtPoint[],
terminatingStation: string,
overallLength: number | null,
arriving: boolean,
): Promise<AudioItem[]> {
const files: AudioItem[] = []

const callingPointsWithSplits = await this.getCallingPointsWithSplits(callingPoints, terminatingStation, overallLength)
const callingPointsWithSplits = await this.getCallingPointsWithSplits(callingPoints, terminatingStation, overallLength, arriving)

if (callingPointsWithSplits.length !== 0) {
files.push({ id: 'm.calling at', opts: { delayStart: this.callingPointsOptions.beforeCallingAtDelay } }, ...callingPointsWithSplits)
Expand Down Expand Up @@ -4228,6 +4233,7 @@ export default class AmeyPhil extends StationAnnouncementSystem {
options.callingAt,
options.terminatingStationCode,
options.coaches ? parseInt(options.coaches.split(' ')[0]) : null,
false,
)),
)
} catch (e) {
Expand Down Expand Up @@ -4324,6 +4330,7 @@ export default class AmeyPhil extends StationAnnouncementSystem {
options.callingAt,
options.terminatingStationCode,
options.coaches ? parseInt(options.coaches.split(' ')[0]) : null,
true,
)),
)
} catch (e) {
Expand Down

0 comments on commit b609208

Please sign in to comment.