Browse Source

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.
pull/17/head
Robert Miles 9 months ago
parent
commit
6b6bc48ae7
  1. 2
      schedule/ics.php

2
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.

Loading…
Cancel
Save