From 4296875b9f5889c2e7a23d76c4367fb920190617 Mon Sep 17 00:00:00 2001 From: Caleb Denio Date: Tue, 13 Oct 2026 08:17:20 -0600 Subject: [PATCH] improve handling of service exceptions --- pkg/gtfs/gtfs.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/gtfs/gtfs.go b/pkg/gtfs/gtfs.go index 234d006..5e05c6d 100644 --- a/pkg/gtfs/gtfs.go +++ b/pkg/gtfs/gtfs.go @@ -19,9 +19,11 @@ func GetActiveServiceIDs(t *time.Time, db *sql.DB) ([]string, error) { when 5 then friday when 6 then saturday end - ) AND $2 >= start_date AND $2 <= end_date + ) AND $2 >= start_date AND $2 <= end_date AND NOT EXISTS ( + SELECT calendar_dates.service_id FROM calendar_dates WHERE calendar_dates.service_id = calendar.service_id AND calendar_dates.date = $2 AND calendar_dates.exception_type = 2 + ) union - select service_id from calendar_dates where date = $2;`, weekday, t.Format("20060102")) + select service_id from calendar_dates where date = $2 AND exception_type = 1;`, weekday, t.Format("20060102")) if err != nil { return nil, err