fixes for journeyID and fahrtNr

This commit is contained in:
Traines 2024-12-10 22:49:11 +00:00
parent 491348bd3b
commit c6bb1b468a
3 changed files with 2 additions and 3 deletions

View file

@ -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);

View file

@ -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),

View file

@ -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,
};