From 7f78dc9458254afe8a86ce7ac33ffc976764a9a7 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Tue, 12 Mar 2024 12:26:46 +0100 Subject: [PATCH] add todos & comments --- p/db/index.js | 2 ++ parse/hint.js | 3 +++ parse/journey-leg.js | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/p/db/index.js b/p/db/index.js index c40e8094..2a2ffaf0 100644 --- a/p/db/index.js +++ b/p/db/index.js @@ -51,6 +51,8 @@ const transformReq = (ctx, req) => { }); } + // todo: `LocGeoPos`/nearby() breaks with `getStops: false` + return req; }; diff --git a/parse/hint.js b/parse/hint.js index dcc75a2b..33dde069 100644 --- a/parse/hint.js +++ b/parse/hint.js @@ -110,6 +110,9 @@ const linkTypesByCode = Object.assign(Object.create(null), { // "durS": "091400" // } +// todo bvg: +// {"type": "R", "code": "text.realtime.journey.cancelled", "icoX": 7, "txtN": ": S41"} with icon {"res": "rt_cancel"} + const parseHint = (ctx, h) => { // todo: C diff --git a/parse/journey-leg.js b/parse/journey-leg.js index 8e66d345..bddff3b0 100644 --- a/parse/journey-leg.js +++ b/parse/journey-leg.js @@ -113,6 +113,14 @@ const parseJourneyLeg = (ctx, pt, date) => { // pt = raw leg res.transfer = true; } if (pt.type === 'DEVI') { + // > DEVI Legs are Deviations. + // > It happens if you ask for a route to a specific stopPlace but HAFAS returns one to another stopPlace. Happens mainly in the night when there is no route to you destination for the forseeable future. + // > For Instance you want to go from Berlin Hbf to München Hbf. One of the only routes to München is to München Ost with a NJ at your time. + // > HAFAS returns that NJ and the last leg is a DEVI that just says "you wanted München HBF, this route ends in München Ost" + + // > Bahn.de for instance ignores this completly, the DEVI leg also has no real information. + // https://github.com/public-transport/hafas-client/issues/301#issuecomment-1840820895 + // todo: pt.resState, pt.resRecommendation res.transfer = true; }