Fix weird Flemington Racecourse/South Kensington bugs in PTV API

This commit is contained in:
RunasSudo 2019-01-01 19:00:21 +11:00
parent 21c95dda4c
commit fdf9392d38
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -39,6 +39,15 @@ timezone = pytz.timezone('Australia/Melbourne')
def index(): def index():
return flask.render_template('index.html') return flask.render_template('index.html')
def stop_to_name(stop, route_id):
name = stop['stop_name']
if name.endswith(' Station'):
name = name[:-8]
if name == 'Flemington Racecourse' and route_id and route_id != 16 and route_id != 17 and route_id != 1482:
# PTV bug??
name = 'South Kensington'
return name
route_stops = {} # Cache lookup route_stops = {} # Cache lookup
def parse_departure(departure, departures, timenow): def parse_departure(departure, departures, timenow):
result = {} result = {}