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,11 +131,16 @@ namespace director
|
||||
Occurrence = occurrence,
|
||||
Showtime = occurrence.OccurrenceStart
|
||||
};
|
||||
var asActualEvent = iCalHoopJumping.parseEvent(calLabel, occurrence.Event);
|
||||
|
||||
if(scratch.agenda.FirstOrDefault(s => iCalHoopJumping.parseEvent(calLabel, s.Occurrence.Event)?.Uid == asActualEvent.Uid) == null)
|
||||
{
|
||||
createSchedulable(ref newSchedulable);
|
||||
scratch.agenda.Add(newSchedulable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void threadwork()
|
||||
{
|
||||
Schedulable.Schedulable todo = null;
|
||||
|
@ -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.
|
||||
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 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)
|
||||
{
|
||||
if (ser.SerializeToString(evt) == eventStr)
|
||||
|
Loading…
Reference in New Issue
Block a user