mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
parent
40df65f462
commit
2612494970
3 changed files with 6 additions and 7 deletions
|
@ -19,8 +19,8 @@ const createParseArrOrDep = (prefix) => {
|
||||||
const tPrognosed = d.stbStop[prefix + 'TimeR']
|
const tPrognosed = d.stbStop[prefix + 'TimeR']
|
||||||
const tzOffset = d.stbStop[prefix + 'TZOffset'] || null
|
const tzOffset = d.stbStop[prefix + 'TZOffset'] || null
|
||||||
const cancelled = !!d.stbStop[prefix + 'Cncl']
|
const cancelled = !!d.stbStop[prefix + 'Cncl']
|
||||||
const plPlanned = d.stbStop[prefix + 'PlatfS']
|
const plPlanned = d.stbStop[prefix + 'PlatfS'] || (d.stbStop[prefix + 'PltfS'] && d.stbStop[prefix + 'PltfS'].txt) || null
|
||||||
const plPrognosed = d.stbStop[prefix + 'PlatfR']
|
const plPrognosed = d.stbStop[prefix + 'PlatfR'] || (d.stbStop[prefix + 'PltfR'] && d.stbStop[prefix + 'PltfR'].txt) || null
|
||||||
|
|
||||||
const res = {
|
const res = {
|
||||||
tripId: d.jid,
|
tripId: d.jid,
|
||||||
|
|
|
@ -89,13 +89,12 @@ const parseJourneyLeg = (ctx, pt, date) => { // pt = raw leg
|
||||||
res.tripId = pt.jny.jid
|
res.tripId = pt.jny.jid
|
||||||
res.line = pt.jny.line || null
|
res.line = pt.jny.line || null
|
||||||
res.direction = pt.jny.dirTxt && profile.parseStationName(ctx, pt.jny.dirTxt) || null
|
res.direction = pt.jny.dirTxt && profile.parseStationName(ctx, pt.jny.dirTxt) || null
|
||||||
|
const arrPl = profile.parsePlatform(ctx, pt.arr.aPlatfS || (pt.arr.aPltfS !== undefined ? pt.arr.aPltfS.txt : null), pt.arr.aPlatfR || (pt.arr.aPltfR !== undefined ? pt.arr.aPltfR.txt : null), pt.arr.aCncl)
|
||||||
const arrPl = profile.parsePlatform(ctx, pt.arr.aPlatfS, pt.arr.aPlatfR, pt.arr.aCncl)
|
|
||||||
res.arrivalPlatform = arrPl.platform
|
res.arrivalPlatform = arrPl.platform
|
||||||
res.plannedArrivalPlatform = arrPl.plannedPlatform
|
res.plannedArrivalPlatform = arrPl.plannedPlatform
|
||||||
if (arrPl.prognosedPlatform) res.prognosedArrivalPlatform = arrPl.prognosedPlatform
|
if (arrPl.prognosedPlatform) res.prognosedArrivalPlatform = arrPl.prognosedPlatform
|
||||||
|
|
||||||
const depPl = profile.parsePlatform(ctx, pt.dep.dPlatfS, pt.dep.dPlatfR, pt.dep.dCncl)
|
const depPl = profile.parsePlatform(ctx, pt.dep.dPlatfS || (pt.dep.dPltfS !== undefined ? pt.dep.dPltfS.txt : null), pt.dep.dPlatfR || (pt.dep.dPltfR !== undefined ? pt.dep.dPltfR.txt : null), pt.dep.dCncl)
|
||||||
res.departurePlatform = depPl.platform
|
res.departurePlatform = depPl.platform
|
||||||
res.plannedDeparturePlatform = depPl.plannedPlatform
|
res.plannedDeparturePlatform = depPl.plannedPlatform
|
||||||
if (depPl.prognosedPlatform) res.prognosedDeparturePlatform = depPl.prognosedPlatform
|
if (depPl.prognosedPlatform) res.prognosedDeparturePlatform = depPl.prognosedPlatform
|
||||||
|
|
|
@ -6,9 +6,9 @@ const parseStopover = (ctx, st, date) => { // st = raw stopover
|
||||||
const {profile, opt} = ctx
|
const {profile, opt} = ctx
|
||||||
|
|
||||||
const arr = profile.parseWhen(ctx, date, st.aTimeS, st.aTimeR, st.aTZOffset, st.aCncl)
|
const arr = profile.parseWhen(ctx, date, st.aTimeS, st.aTimeR, st.aTZOffset, st.aCncl)
|
||||||
const arrPl = profile.parsePlatform(ctx, st.aPlatfS, st.aPlatfR, st.aCncl)
|
const arrPl = profile.parsePlatform(ctx, st.aPlatfS || (st.aPltfS && st.aPltfS.txt) || null, st.aPlatfR || (st.aPltfR && st.aPltfR.txt) || null, st.aCncl)
|
||||||
const dep = profile.parseWhen(ctx, date, st.dTimeS, st.dTimeR, st.dTZOffset, st.dCncl)
|
const dep = profile.parseWhen(ctx, date, st.dTimeS, st.dTimeR, st.dTZOffset, st.dCncl)
|
||||||
const depPl = profile.parsePlatform(ctx, st.dPlatfS, st.dPlatfR, st.dCncl)
|
const depPl = profile.parsePlatform(ctx, st.dPlatfS || (st.dPltfS && st.dPltfS.txt) || null, st.dPlatfR || (st.dPltfR && st.dPltfR.txt) || null, st.dCncl)
|
||||||
|
|
||||||
const res = {
|
const res = {
|
||||||
stop: st.location || null,
|
stop: st.location || null,
|
||||||
|
|
Loading…
Add table
Reference in a new issue