From c6bb1b468abb481fb2f044d3d463543ef2d8b8bc Mon Sep 17 00:00:00 2001 From: Traines Date: Tue, 10 Dec 2024 22:49:11 +0000 Subject: [PATCH] fixes for journeyID and fahrtNr --- lib/request.js | 1 - parse/arrival-or-departure.js | 2 +- parse/line.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/request.js b/lib/request.js index cab54b90..c223bd21 100644 --- a/lib/request.js +++ b/lib/request.js @@ -153,7 +153,6 @@ const request = async (ctx, userAgent, reqData) => { } const body = await res.text(); - console.log(body); profile.logResponse(ctx, res, body, reqId); const b = JSON.parse(body); diff --git a/parse/arrival-or-departure.js b/parse/arrival-or-departure.js index 82f18c62..6893c04e 100644 --- a/parse/arrival-or-departure.js +++ b/parse/arrival-or-departure.js @@ -12,7 +12,7 @@ const createParseArrOrDep = (prefix) => { const {profile, opt} = ctx; const res = { - tripId: d.journeyID, + tripId: d.journeyID || d.train.journeyId, stop: profile.parseLocation(ctx, d.station), ...profile.parseWhen(ctx, null, d.timeSchedule ? d.timeSchedule : d.time, d.timePredicted ? d.timePredicted : d.time, d.canceled), ...profile.parsePlatform(ctx, d.platformSchedule ? d.platformSchedule : d.platform, d.platformPredicted ? d.platformPredicted : d.platform, d.canceled), diff --git a/parse/line.js b/parse/line.js index cf1e3c57..7f5b60eb 100644 --- a/parse/line.js +++ b/parse/line.js @@ -5,7 +5,7 @@ const parseLine = (ctx, p) => { const res = { type: 'line', id: slugg(p.verkehrsmittel?.langText || p.transport?.journeyDescription || p.train?.no), // TODO terrible - fahrtNr: p.verkehrsmittel?.nummer || p.transport?.number || p.train?.no, + fahrtNr: (p.verkehrsmittel?.nummer || p.transport?.number || p.train?.no)+'', name: p.verkehrsmittel?.name || p.zugName || p.transport?.journeyDescription || p.train && p.train.category + ' ' + p.train.lineName, public: true, };