Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Bug in the id_prefix "de:09162:"? #30

Open
Stephaela opened this issue Feb 20, 2023 · 1 comment
Open

Bug in the id_prefix "de:09162:"? #30

Stephaela opened this issue Feb 20, 2023 · 1 comment

Comments

@Stephaela
Copy link

Hey everyone! :)

I might have noticed a small bug. The id_prefix is defined as "de:09162:" and is used to convert the IDs. But I think that there is a problem with this definition. For many stations, it is correct, but there are stations with another prefix, for example "Garching, Forschungszentrum" has the ID "de:09184:460" (see https://www.mvg.de/api/fahrinfo/location/query?q=forschungszentrum). So I'm afraid that for some stations the code produces wrong IDs. I think that "09162" is only correct for stations located inside Munich and I think that stations somewhere else use another number (but I'm not 100% sure about that).

It would be really cool if you could fix that. Thank you! :)

(by the way, this is my first issue, so if I do something wrong, please don't be angry and just tell me what I can do better next time :) )

@leftshift
Copy link
Owner

Hey, thanks for raising this issue!

Some history: the id_prefix was added after a change in the api; before, the station IDs didn't have any prefix. The code with the id_prefix was added as a workaround so old code would continue working.

It seems like you're the first person to notice this issue. Unfortunately, I'm not sure there is a clean way to fix the conversion logic as we wouldn't know what would be the correct prefix for that ID.

Ideally, if you use the new IDs with a prefix everywhere, everything should work, or is there a case where there is an error?

As a sidenote, I'm not really actively developing this library anymore, I would suggest to maybe check out https://github.com/mondbaron/mvg instead, which is a more modern take and uses the newer API endpoint rather than the legacy one this library uses.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants