From 8b72e32771a181d645d2d1e06359fd27c508aa76 Mon Sep 17 00:00:00 2001 From: khuxkm fbexl Date: Mon, 28 Sep 2020 22:04:15 +0000 Subject: [PATCH] Well, this is embarrassing... Apparently I put too much faith in AzuraCast's scheduler. IDs are per-DJ, not per-slot, and some DJs (like tomasino) run multiple shows out of the same login. Ergo, this simply will not do. The ID now used in the dedupe also includes beginning and ending, leading to a slot looking like "13Sun000000Sun010000". This *should* be unique, since AFAIK no DJ has multiple slots during the same time and the same login. (Not to mention slots really can't be at the same time.) --- schedule/ics.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/schedule/ics.php b/schedule/ics.php index 1c12f77..cef6c00 100644 --- a/schedule/ics.php +++ b/schedule/ics.php @@ -28,8 +28,9 @@ echo "DTSTAMP:".ics_formatdate("now").ICS_EOL; $event_ids = array(); foreach ($schedule as $event) { - if (!in_array($event["id"],$event_ids)){ - array_push($event_ids,$event["id"]); + $id = strval($event["id"]).gmdate("DHis").gmdate("DHis"); + if (!in_array($id,$event_ids)){ + array_push($event_ids,$id); // The VEVENT structure's pretty easy to generate, especially since we're already in UTC. echo "BEGIN:VEVENT".ICS_EOL; // First, we need a creation date.