mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
parseLine: don't use prodCtx.num 🐛
This commit is contained in:
parent
0408f92257
commit
eddf110894
2 changed files with 3 additions and 4 deletions
|
@ -20,7 +20,7 @@ const createParseDeparture = (profile, stations, lines, remarks) => {
|
||||||
remarks: d.remL ? d.remL.map(findRemark) : [],
|
remarks: d.remL ? d.remL.map(findRemark) : [],
|
||||||
trip: +d.jid.split('|')[1] // todo: this seems brittle
|
trip: +d.jid.split('|')[1] // todo: this seems brittle
|
||||||
}
|
}
|
||||||
// todo: res.trip from rawLine.prodCtx.num
|
// todo: res.trip from rawLine.prodCtx.num?
|
||||||
|
|
||||||
if (d.stbStop.dTimeR && d.stbStop.dTimeS) {
|
if (d.stbStop.dTimeR && d.stbStop.dTimeS) {
|
||||||
const realtime = profile.parseDateTime(profile, d.date, d.stbStop.dTimeR)
|
const realtime = profile.parseDateTime(profile, d.date, d.stbStop.dTimeR)
|
||||||
|
|
|
@ -12,11 +12,10 @@ const createParseLine = (profile, operators) => {
|
||||||
name: p.line || p.name,
|
name: p.line || p.name,
|
||||||
public: true
|
public: true
|
||||||
}
|
}
|
||||||
|
// todo: what is p.prodCtx && p.prodCtx.num?
|
||||||
|
|
||||||
// We don't get a proper line id from the API, so we use the trip nr here.
|
|
||||||
// todo: find a better way
|
|
||||||
if (p.prodCtx && p.prodCtx.num) res.id = p.prodCtx.num
|
|
||||||
// This is terrible, but FPTF demands an ID. Let's pray for VBB to expose an ID.
|
// This is terrible, but FPTF demands an ID. Let's pray for VBB to expose an ID.
|
||||||
|
// todo: find a better way
|
||||||
else if (p.line) res.id = slugg(p.line.trim())
|
else if (p.line) res.id = slugg(p.line.trim())
|
||||||
else if (p.name) res.id = slugg(p.name.trim())
|
else if (p.name) res.id = slugg(p.name.trim())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue