@@ -138,10 +138,8 @@ def parseRouteOrUrl(
138
138
for route_info in json :
139
139
start_in_route = False
140
140
end_in_route = False
141
- # Assume the first segment_start_time is the start of the route
142
- route_start_time = route_info ["segment_start_times" ][0 ]
143
- # Assume the last segment_end_time is the end of the route
144
- route_end_time = route_info ["segment_end_times" ][- 1 ]
141
+ route_start_time = route_info ["start_time_utc_millis" ]
142
+ route_end_time = route_info ["end_time_utc_millis" ]
145
143
# Check if the start time is in the route
146
144
if start_time >= route_start_time and start_time <= route_end_time :
147
145
start_in_route = True
@@ -163,10 +161,17 @@ def parseRouteOrUrl(
163
161
# Get the route name
164
162
route_name = matched_route ["fullname" ]
165
163
# Compute the start seconds
164
+
166
165
start_seconds = (start_time - route_start_time ) // 1000
167
166
# Compute the length seconds
168
167
length_seconds = (end_time - start_time ) // 1000
169
168
169
+ print (f"Route: { route_name } " )
170
+ print (f"Matched Route: { matched_route } " )
171
+ print (f"Start Seconds: { start_seconds } " )
172
+ print (f"Start Time: { start_time } " )
173
+ print (f'Route Start Time: { route_start_time } ' )
174
+ print (f"Length Seconds: { length_seconds } " )
170
175
# Return the parsed route
171
176
return ParsedRouteOrURL (route_name , start_seconds , length_seconds )
172
177
0 commit comments