From 3ca4a0c2b2912aa7631d7a5cc0b8dab31f5371ab Mon Sep 17 00:00:00 2001 From: Julius Tens Date: Tue, 9 Jun 2020 12:46:13 +0200 Subject: [PATCH] add provenance field on arrivals --- parse/arrival-or-departure.js | 1 + test/fixtures/vbb-departures.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/parse/arrival-or-departure.js b/parse/arrival-or-departure.js index 43b599bd..6da0c078 100644 --- a/parse/arrival-or-departure.js +++ b/parse/arrival-or-departure.js @@ -29,6 +29,7 @@ const createParseArrOrDep = (prefix) => { ...profile.parsePlatform(ctx, plPlanned, plPrognosed, cancelled), // todo: for arrivals, this is the *origin*, not the *direction* direction: prefix === DEPARTURE && d.dirTxt && profile.parseStationName(ctx, d.dirTxt) || null, + provenance: prefix === ARRIVAL && d.dirTxt && profile.parseStationName(ctx, d.dirTxt) || null, line: d.line || null, remarks: [] } diff --git a/test/fixtures/vbb-departures.js b/test/fixtures/vbb-departures.js index 8acfb315..af9b5c51 100644 --- a/test/fixtures/vbb-departures.js +++ b/test/fixtures/vbb-departures.js @@ -185,6 +185,7 @@ module.exports = [ platform: null, plannedPlatform: null, direction: 'S+U Hermannstr.', + provenance: null, line: { type: 'line', id: 'u8', @@ -849,6 +850,7 @@ module.exports = [ platform: null, plannedPlatform: null, direction: 'U Paracelsus-Bad', + provenance: null, line: { type: 'line', id: 'u8', @@ -1608,6 +1610,7 @@ module.exports = [ platform: '4', plannedPlatform: '4', direction: 'S Spandau', + provenance: null, line: { type: 'line', id: 's9',