From 6b6bc48ae7e13b826bba0a56f6eaf6b8acf021ad Mon Sep 17 00:00:00 2001 From: khuxkm fbexl Date: Mon, 28 Sep 2020 23:27:31 +0000 Subject: [PATCH] PHP is annoying and I want to stab whoever designed AzuraCast's API From the top: - gmdate needs an argument of what time to use. this one is on me being tired, but I shouldn't have to do this because - IDs are per-DJ, not per-slot, as I mentioned in my last PR. This wasn't the reason behind the issue, but if IDs were per-slot, my original dedupe would have worked *perfectly*. - AzuraCast's API gives weird ISO-8601 date strings instead of just *giving us UNIX timestamps*. Again, not the reason behind the issue, but it annoyed me when testing the dedupe fix. --- schedule/ics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schedule/ics.php b/schedule/ics.php index cef6c00..e5d5ff4 100644 --- a/schedule/ics.php +++ b/schedule/ics.php @@ -28,7 +28,7 @@ echo "DTSTAMP:".ics_formatdate("now").ICS_EOL; $event_ids = array(); foreach ($schedule as $event) { - $id = strval($event["id"]).gmdate("DHis").gmdate("DHis"); + $id = strval($event["id"]).gmdate("DHis",strtotime($event["start"])).gmdate("DHis",strtotime($event["end"])); 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. -- 2.34.1