Show indivudal train legs

This commit is contained in:
Edward Betts 2024-05-18 14:23:00 +02:00
parent 5b2d248955
commit 85ebaf7c84

View file

@ -224,15 +224,16 @@ class Trip:
)
)
if item["type"] == "train":
name = f"{item['from']} -> {item['to']}"
elements.append(
TripElement(
when=item["depart"],
title=name,
detail=item,
element_type="train",
for leg in item["legs"]:
name = f"{leg['from']}{leg['to']}"
elements.append(
TripElement(
when=leg["depart"],
title=name,
detail=leg,
element_type="train",
)
)
)
if item["type"] == "ferry":
name = f"{item['from']}{item['to']}"
elements.append(