@@ 139,7 139,7 @@ defmodule Triglav.PublicTransport do
SELECT route.id,
count(*) FILTER (WHERE variant.id IS NOT NULL) AS matched_count,
count(*) FILTER (WHERE variant.id IS NULL) AS unmatched_count,
- (SELECT count(*) FROM pt_route_variants WHERE route_id = route.id) AS total_count
+ (SELECT count(*) FROM pt_route_variants WHERE feed_id = $1 AND route_id = route.id) AS total_count
FROM pt_routes AS route
LEFT JOIN pt_route_mapped_route_relations ON route_id = route.id
LEFT JOIN pt_route_variants AS variant