departures/arrivals: add results option

This commit is contained in:
Jannis R 2020-03-20 20:02:42 +01:00 committed by Jannis Redmann
parent 70c02199b2
commit ae74bb420d
2 changed files with 4 additions and 0 deletions

View file

@ -14,6 +14,9 @@ const formatStationBoardReq = (ctx, station, type) => {
],
dur: opt.duration
}
if (opt.results !== null) {
req.maxJny = opt.results === Infinity ? 10000 : opt.results
}
if (profile.departuresGetPasslist) req.getPasslist = !!opt.stopovers
if (profile.departuresStbFltrEquiv) req.stbFltrEquiv = !opt.includeRelatedStations

View file

@ -51,6 +51,7 @@ const createClient = (profile, userAgent, opt = {}) => {
// todo: for arrivals(), this is actually a station it *has already* stopped by
direction: null, // only show departures stopping by this station
duration: 10, // show departures for the next n minutes
results: 50, // max. number of results `null` means "whatever HAFAS wants"
linesOfStops: false, // parse & expose lines at the stop/station?
remarks: true, // parse & expose hints & warnings?
stopovers: false, // fetch & parse previous/next stopovers?