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.)
This commit is contained in:
Robert Miles 2020-09-28 22:04:15 +00:00
parent b0d14c0ebb
commit 8b72e32771
1 changed files with 3 additions and 2 deletions

View File

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