if (rec.ScheduleType == (int)ScheduleRecordingType.SeriesLink)
{
Channel scheduleChannel = rec.ReferencedChannel();
if (scheduleChannel == null)
return recordings;
if (rec.SeriesId == "0")
return recordings;
TvDatabase.Program currentProgram = scheduleChannel.GetNextProgram(dtDay, 0, rec.SeriesId);
if (currentProgram == null)
return recordings;
Schedule recNew = rec.Clone();
recNew.ScheduleType = (int)ScheduleRecordingType.Once;
recNew.StartTime = new DateTime(currentProgram.StartTime.Year, currentProgram.StartTime.Month, currentProgram.StartTime.Day, currentProgram.StartTime.Hour, currentProgram.StartTime.Minute,
0);
recNew.EndTime = new DateTime(currentProgram.EndTime.Year, currentProgram.EndTime.Month, currentProgram.EndTime.Day, currentProgram.EndTime.Hour, currentProgram.EndTime.Minute, 0);
recNew.Series = true;
if (recNew.StartTime >= DateTime.Now)
{
if (rec.IsSerieIsCanceled(recNew.StartTime))
{
recNew.Canceled = recNew.StartTime;
}
recordings.Add(recNew);
}
return recordings;
}
public Program GetNextProgram(DateTime date, int tt, string seriesId)
{
SqlBuilder sb = new SqlBuilder(StatementType.Select, typeof(Program));
sb.AddConstraint(Operator.Equals, "idChannel", IdChannel);
sb.AddConstraint(Operator.Equals, "seriesId", seriesId);
sb.AddConstraint(Operator.GreaterThan, "startTime", date);
sb.AddOrderByField(true, "startTime");
sb.SetRowLimit(1);
SqlStatement stmt = sb.GetStatement(true);
IList<Program> programs = ObjectFactory.GetCollection<Program>(stmt.Execute());
if (programs.Count == 0)
{
return null;
}
return programs[0];
}
Hi there,
If you're feeling adventurous...any chance of looking into the issue of all cards needing to be free before EPG grabbing occurs?
J.