hopefully won't double-enqueue if it happens to check calendars again while the previous event is waiting
This commit is contained in:
parent
d2f384f4d7
commit
1fe14e966f
@ -131,8 +131,13 @@ namespace director
|
|||||||
Occurrence = occurrence,
|
Occurrence = occurrence,
|
||||||
Showtime = occurrence.OccurrenceStart
|
Showtime = occurrence.OccurrenceStart
|
||||||
};
|
};
|
||||||
createSchedulable(ref newSchedulable);
|
var asActualEvent = iCalHoopJumping.parseEvent(calLabel, occurrence.Event);
|
||||||
scratch.agenda.Add(newSchedulable);
|
|
||||||
|
if(scratch.agenda.FirstOrDefault(s => iCalHoopJumping.parseEvent(calLabel, s.Occurrence.Event)?.Uid == asActualEvent.Uid) == null)
|
||||||
|
{
|
||||||
|
createSchedulable(ref newSchedulable);
|
||||||
|
scratch.agenda.Add(newSchedulable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,12 +20,12 @@ namespace director
|
|||||||
|
|
||||||
//I don't understand why the entire .net ecosystem insists on ignoring ToString(). Is it really that much fun writing ThingSerializerFactory? ...java programmers.
|
//I don't understand why the entire .net ecosystem insists on ignoring ToString(). Is it really that much fun writing ThingSerializerFactory? ...java programmers.
|
||||||
private static EventSerializer ser = new EventSerializer();
|
private static EventSerializer ser = new EventSerializer();
|
||||||
public static CalendarEvent parseEvent(string calendar, string eventStr)
|
public static CalendarEvent parseEvent(string calendarLabel, string eventStr)
|
||||||
{
|
{
|
||||||
//return new CalendarEvent(eventStr); //lol no
|
//return new CalendarEvent(eventStr); //lol no
|
||||||
//return CalendarEvent.Parse(eventStr); //lol no
|
//return CalendarEvent.Parse(eventStr); //lol no
|
||||||
|
|
||||||
var cal = Calendar.Load(Program.scratch.Calendars[calendar]);
|
var cal = Calendar.Load(Program.scratch.Calendars[calendarLabel]);
|
||||||
foreach (var evt in cal.Events)
|
foreach (var evt in cal.Events)
|
||||||
{
|
{
|
||||||
if (ser.SerializeToString(evt) == eventStr)
|
if (ser.SerializeToString(evt) == eventStr)
|
||||||
|
Loading…
Reference in New Issue
Block a user