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.
This commit is contained in:
Robert Miles 2020-09-28 23:27:31 +00:00
parent 8b72e32771
commit 6b6bc48ae7
1 changed files with 1 additions and 1 deletions

View File

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