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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user