alexander-albers / tripkit

Swift library for querying data from public transport providers.
MIT License
81 stars 8 forks source link

Products always return nil #80

Closed victorlobe closed 1 year ago

victorlobe commented 1 year ago

I am not able to get products of a station, I tried it with the queryDepartures and the queryTrips function but it always return nil. i use the MVV provider but I tried it also with the DB provider.

secondly I am not able to get the products used in a trip. The only parameter where I can see products in log is the trip ID.

Thanks you!

alexander-albers commented 1 year ago

Hi @victorlobe, thanks for reporting the issue. It is correct that the product variable is currently not being used. However, this is currently not a priority for me, as not all providers return the required information for it anyway. You can always just use the lines variable in ServingLine - that's what the ÖPNV Navigator is using.

Regarding your second issue, could you please elaborate which field you are trying to access?

victorlobe commented 1 year ago

Hey, thanks for your reply. I will try this. My second issue is about the Trips feature. I am able to get a trip but I don't know how to get the Lines (or vehicles) used by a trip.

alexander-albers commented 1 year ago

You have to access to legs property and cast it to either an IndividualLeg (footpaths) or PublicLeg. The latter gives you a line property that you can access.