From 17aeacf594e919074b341b3f9953cbb84e2f3c9f Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 28 Jun 2018 13:32:42 +0200 Subject: [PATCH] arrivals/departures: fix remarks parsing :bug: --- parse/arrival-or-departure.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parse/arrival-or-departure.js b/parse/arrival-or-departure.js index e4cc0adb..f6f7874a 100644 --- a/parse/arrival-or-departure.js +++ b/parse/arrival-or-departure.js @@ -19,9 +19,10 @@ const createParseArrOrDep = (profile, opt, data, prefix) => { when: when.toISO(), direction: profile.parseStationName(d.dirTxt), line: lines[parseInt(d.prodX)] || null, - remarks: (d.remL - ? d.remL.map(ref => findRemark(hints, warnings, ref)) - : [] + remarks: ([] + .concat(d.remL || [], d.msgL || []) + .map(ref => findRemark(hints, warnings, ref)) + .filter(rem => !!rem) // filter unparsable ), // todo: res.trip from rawLine.prodCtx.num? trip: +d.jid.split('|')[1] // todo: this seems brittle