parseLine: don't use prodCtx.num 🐛

This commit is contained in:
Jannis R 2018-01-23 02:37:08 +01:00
parent 0408f92257
commit eddf110894
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 3 additions and 4 deletions

View file

@ -20,7 +20,7 @@ const createParseDeparture = (profile, stations, lines, remarks) => {
remarks: d.remL ? d.remL.map(findRemark) : [],
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) {
const realtime = profile.parseDateTime(profile, d.date, d.stbStop.dTimeR)

View file

@ -12,11 +12,10 @@ const createParseLine = (profile, operators) => {
name: p.line || p.name,
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.
// todo: find a better way
else if (p.line) res.id = slugg(p.line.trim())
else if (p.name) res.id = slugg(p.name.trim())