feat: add source file tracking to rem type

Add a `source` field to `Remind.rem` to track the originating iCalendar
filename (basename without extension). Thread the basename through
`remind_of_event` so each reminder records which file it came from.
This commit is contained in:
2026-05-16 22:14:27 +02:00
parent 0a9f5ce265
commit 139893f2e6
3 changed files with 6 additions and 3 deletions

View File

@@ -326,7 +326,7 @@ let all_collectors : collector list =
simple_recurrence;
]
let remind_of_event (ev : Icalendar.event list) : (Remind.rem, error) result =
let remind_of_event (source : string) (ev : Icalendar.event list) : (Remind.rem, error) result =
let () = if List.length ev = 0 then failwith "No events provided" in
let master, recurrence =
@@ -339,7 +339,7 @@ let remind_of_event (ev : Icalendar.event list) : (Remind.rem, error) result =
end
in
let rem = { Remind.empty with Remind.recurring = recurrence } in
let rem = { Remind.empty with Remind.source; Remind.recurring = recurrence } in
ListLabels.fold_left ~init:(Ok rem) all_collectors ~f:(fun rem_or_error pred ->
match rem_or_error with