Hi all,
I'm writing some code to schedule a recording from another app. It's working, but for programs that start in a few minutes, or have already started, the recording starts too late. It's like the schedule isn't in the database in time. This is the coding:
I've tried adding server.IsTimeToRecord(DateTime.Now) but this doesn't help. Any suggestions to correct this little problem? Thanks!
Chris
I'm writing some code to schedule a recording from another app. It's working, but for programs that start in a few minutes, or have already started, the recording starts too late. It's like the schedule isn't in the database in time. This is the coding:
Code:
TvBusinessLayer layer = new TvBusinessLayer();
Schedule rec = new Schedule(MpProgram.IdChannel, MpProgram.Title, MpProgram.StartTime, MpProgram.EndTime);
rec.PreRecordInterval = Int32.Parse(layer.GetSetting("preRecordInterval", "5").Value);
rec.PostRecordInterval = Int32.Parse(layer.GetSetting("postRecordInterval", "5").Value);
rec.ScheduleType = (int)TvDatabase.ScheduleRecordingType.Once;
rec.Persist();
TvServer server = new TvServer();
server.OnNewSchedule();
I've tried adding server.IsTimeToRecord(DateTime.Now) but this doesn't help. Any suggestions to correct this little problem? Thanks!
Chris